Github Release #53
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: Github Release | |
| env: | |
| NODE_VERSION: 22 | |
| PNPM_VERSION: 10.7.1 | |
| # Workflow need write access to the repository to create a GitHub release | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| # Make possible to run manually | |
| workflow_dispatch: | |
| inputs: | |
| # warn before running manually | |
| warning: | |
| description: 'Should be run only for tags like `v*`' | |
| required: false | |
| type: boolean | |
| # Make sure that only one release workflow runs at a time. | |
| concurrency: | |
| group: release | |
| jobs: | |
| release: | |
| name: Create GitHub release | |
| runs-on: ubuntu-latest | |
| # Only run this job for v* tags | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v3 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| run_install: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: https://registry.npmjs.org | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run ESLint | |
| run: pnpm lint | |
| # building is needed for tests (bundle test depends on it) | |
| - name: Build package | |
| run: pnpm build | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Release on GitHub | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| draft: false | |
| prerelease: false | |
| body: See [CHANGELOG.md](../master/CHANGELOG.md) for the list of changes. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| notify: | |
| name: Send Slack notification | |
| needs: | |
| - release | |
| if: | |
| ${{ always() && | |
| ( | |
| github.event_name == 'push' || | |
| github.event_name == 'workflow_dispatch' | |
| ) | |
| }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Conclusion | |
| uses: technote-space/workflow-conclusion-action@v3 | |
| - name: Send Slack notification | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: ${{ env.WORKFLOW_CONCLUSION }} | |
| fields: workflow, repo, message, commit, author, eventName, ref | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |