Release #11
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: | |
| overwrite: | |
| description: Overwrite existing release if tag already exists | |
| type: boolean | |
| default: false | |
| jobs: | |
| release: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Read version from package.json | |
| id: version | |
| run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Create config | |
| run: | | |
| echo "export const CLIENT_ID = '${{ secrets.CLIENT_ID }}';" > src/config/config.js | |
| - name: Run checks | |
| run: npm run ci | |
| - name: Build packages | |
| run: npm run build | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG="v${{ steps.version.outputs.version }}" | |
| if [[ "${{ inputs.overwrite }}" == "true" ]]; then | |
| gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true | |
| fi | |
| gh release create "$TAG" \ | |
| --title "$TAG" \ | |
| --generate-notes \ | |
| dist/github-notifier-pro-chrome.zip \ | |
| dist/github-notifier-pro-firefox.zip |