@@ -3,8 +3,8 @@ name: Manual Release
33on :
44 workflow_dispatch :
55 inputs :
6- release_type :
7- description : ' Release Type (patch/minor/major)'
6+ version :
7+ description : ' Version Type (patch/minor/major)'
88 required : true
99 type : choice
1010 options :
1313 - major
1414
1515jobs :
16- create-release :
16+ release :
17+ name : Create Release PR
1718 runs-on : ubuntu-latest
1819 steps :
19- - uses : actions/checkout@v4
20+ - name : Checkout Repo
21+ uses : actions/checkout@v4
2022 with :
2123 fetch-depth : 0
2224
@@ -44,35 +46,31 @@ jobs:
4446 restore-keys : |
4547 ${{ runner.os }}-pnpm-store-
4648
47- - name : Install dependencies
49+ - name : Install Dependencies
4850 run : pnpm install
4951
5052 - name : Setup Git
5153 run : |
5254 git config user.name 'github-actions[bot]'
5355 git config user.email 'github-actions[bot]@users.noreply.github.com'
5456
55- - name : Update version
56- working-directory : ./packages/react-qr-code
57+ - name : Create Changeset
5758 run : |
58- npm version ${{ github.event.inputs.release_type }} --no-git-tag-version
59- echo "NEW_VERSION=$(node -p "require('./package.json') .version")" >> $GITHUB_ENV
59+ pnpm changeset add --empty
60+ echo "# @lglab/react-qr-code\n\n${{ github.event.inputs .version }} release" > .changeset/release.md
6061
61- - name : Build library
62- run : pnpm run build:lib
63-
64- - name : Create release branch
62+ - name : Update Version
63+ id : create_version_pr
6564 run : |
66- git checkout -b release/v${{ env.NEW_VERSION }}
67- git add .
68- git commit -m "chore: release v${{ env.NEW_VERSION }}"
69- git push origin release/v${{ env.NEW_VERSION }}
65+ pnpm changeset version
66+ NEW_VERSION=$(node -p "require('./packages/react-qr-code/package.json').version")
67+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
7068
71- - name : Create Pull Request
72- uses : repo-sync/pull-request@v2
69+ - name : Create PR
70+ uses : changesets/action@v1
7371 with :
74- github_token : ${{ secrets.GITHUB_TOKEN }}
75- destination_branch : ' main '
76- source_branch : ' release/v${{ env.NEW_VERSION }} '
77- pr_title : ' chore: release v${{ env.NEW_VERSION }} '
78- pr_body : ' 🎉 New Release Version: v ${{ env.NEW_VERSION }}'
72+ commit : ' chore: release v ${{ env.NEW_VERSION }}'
73+ title : ' New release v${{ env.NEW_VERSION }} '
74+ createGithubReleases : false
75+ env :
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments