release #2
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
| name: release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "New version to release" | |
| default: "0.0.1" | |
| required: true | |
| type: string | |
| description: | |
| description: "Release description" | |
| type: string | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: npm ci | |
| - run: npm run build | |
| - name: bump package version | |
| run: npm version --no-git-tag-version --new-version ${{ github.event.inputs.version }} | |
| - name: push new build, tag version and push | |
| id: push-tags | |
| run: | | |
| VERSION=${{ github.event.inputs.version }} | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "release bot" | |
| git add package.json dist | |
| git commit -m "$VERSION" | |
| git tag v$VERSION | |
| git push origin main --tags | |
| git tag v$( echo $VERSION | cut -d. -f 1-1 ) | |
| git push origin --tags --force | |
| - uses: ncipollo/[email protected] | |
| with: | |
| tag: v${{ github.event.inputs.version }} | |
| body: ${{ github.event.inputs.description }} |