-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (43 loc) · 1.25 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Release Package
on:
workflow_dispatch:
pull_request:
types:
- closed
branches: # target branch
- master
permissions:
pull-requests: write
contents: write
jobs:
release-package:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
defaults:
run:
working-directory: workspaces/plugin
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/[email protected]
with:
version: 8
run_install: true
- name: Version Package
id: versioning
run: |
npx changeset version
echo "::set-output name=tag::v$(node -pe "require('./package.json').version")"
git restore .
# consume changesets and create pr if it exists, otherwise publish package
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
publish: npx changeset publish
commit: "chore: release ${{ steps.versioning.outputs.tag }}"
title: "chore: release ${{ steps.versioning.outputs.tag }}"