Add comprehensive release workflow #30
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: package-extension | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ['v*'] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bundle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Determine manifest version | |
| id: manifest | |
| run: | | |
| VERSION=$(jq -r '.version // "0.0.0"' manifest.json) | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Create distributable zip | |
| id: package | |
| run: | | |
| set -euo pipefail | |
| VERSION="${{ steps.manifest.outputs.version }}" | |
| ARCHIVE_NAME="slactac_chrome-v${VERSION}.zip" | |
| zip -r "$ARCHIVE_NAME" \ | |
| manifest.json \ | |
| content.js \ | |
| popup.js \ | |
| popup.html \ | |
| popup.css \ | |
| storage.js \ | |
| icons | |
| echo "archive=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: slactac-chrome-${{ steps.manifest.outputs.version }} | |
| path: ${{ steps.package.outputs.archive }} | |
| - name: Upload release asset | |
| if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: ${{ steps.package.outputs.archive }} |