release v2 #1
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 v2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Trigger release manually | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ensure v2.x exists | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| export SHA=$( gh api \ | |
| /repos/$GITHUB_REPOSITORY/git/refs/heads/main \ | |
| | jq --raw-output '.object.sha' ) | |
| gh api /repos/$GITHUB_REPOSITORY/git/refs \ | |
| --field sha="$SHA" \ | |
| --field ref="refs/heads/v2.x" | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v1 | |
| - run: npm ci | |
| - run: npm run build | |
| - uses: ./ | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| dist/index.js | |
| commit-message: Add dist/index.js | |
| ref: refs/heads/v2.x | |
| - uses: actions/upload-artifact@v2 | |
| with: | |
| name: build | |
| path: dist/index.js |