Use git tag name for release package version #7
Workflow file for this run
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: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/test.yml | |
| secrets: inherit | |
| release: | |
| needs: test | |
| runs-on: macos-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extensions | |
| run: npm run build | |
| env: | |
| VERSION_TAG: ${{ github.ref_name }} | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| PRERELEASE_FLAG="" | |
| if [[ "$TAG" == *-* ]]; then | |
| PRERELEASE_FLAG="--prerelease" | |
| fi | |
| gh release create "$TAG" \ | |
| build/bundle/*.zip build/bundle/*.xpi \ | |
| --generate-notes \ | |
| $PRERELEASE_FLAG |