-
Notifications
You must be signed in to change notification settings - Fork 1
chore: create a release workflow #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Prepare Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version_update_type: | ||
| description: What type of version bump should be done | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| jobs: | ||
| prepare: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Use Node.js 20.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20.x | ||
|
|
||
| - name: Bump version | ||
| run: | | ||
| echo "new-version=$(npm version ${{ github.event.inputs.version_update_type }} --no-git-tag-version)" >> $GITHUB_OUTPUT | ||
| id: version | ||
|
|
||
| - name: Create Release PR | ||
| uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 | ||
| with: | ||
| branch: release/${{ steps.version.outputs.new-version }} | ||
| title: Prepare for ${{ steps.version.outputs.new-version }} | ||
| draft: false | ||
| body: An automated PR for next release. | ||
| commit-message: Prepare for ${{ steps.version.outputs.new-version }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Publish Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish Release | ||
| runs-on: ubuntu-latest | ||
| environment: Production | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Use Node.js 20.x | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20.x | ||
|
|
||
| - name: Install Dependencies | ||
| run: npm ci --ignore-engines | ||
|
|
||
| - name: Compile | ||
| run: npm run compile | ||
|
|
||
| - name: Publish | ||
| run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Read Version | ||
| id: get-version | ||
| run: | | ||
| echo "package_version=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Find Release PR | ||
| id: find-pull-request | ||
| uses: juliangruber/find-pull-request-action@48b6133aa6c826f267ebd33aa2d29470f9d9e7d0 # 1.9.0 | ||
| with: | ||
| branch: ${{ github.ref }} | ||
|
|
||
| - name: Merge Pull Request | ||
| uses: juliangruber/merge-pull-request-action@9234b8714dda9a08f3d1df5b2a6a3abd7b695353 # 1.3.1 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| number: ${{ steps.find-pull-request.outputs.number }} | ||
| method: squash | ||
|
|
||
| - name: Publish Github Release | ||
| uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # 1.14.0 | ||
| with: | ||
| generateReleaseNotes: true | ||
| name: ${{ steps.get-version.outputs.package_version }} | ||
| commit: main | ||
| tag: ${{ steps.get-version.outputs.package_version }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| draft: false | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.