feat: add multi-file uploads and bump version to 2.3.4 #36
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: Build Extension | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get version from manifest | |
| id: version | |
| run: | | |
| VERSION=$(jq -r '.version' manifest.json) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create build directory | |
| run: mkdir -p build | |
| # ================== | |
| # Chrome / Edge Build | |
| # ================== | |
| - name: Build Chrome/Edge extension | |
| run: | | |
| mkdir -p build/chrome | |
| # Copy all extension files | |
| cp -r icons fonts build/chrome/ | |
| cp popup.html popup.js filepicker.html filepicker.js background.js ntfy.js styles.css build/chrome/ | |
| # Create Chrome-specific manifest (remove Firefox-specific settings) | |
| node build-manifest.js chrome > build/chrome/manifest.json | |
| # Create ZIP for Chrome Web Store / Edge Add-ons | |
| cd build/chrome | |
| zip -r ../send-to-ntfy-chrome-v${{ steps.version.outputs.version }}.zip . | |
| # ================== | |
| # Firefox Build | |
| # ================== | |
| - name: Build Firefox extension | |
| run: | | |
| mkdir -p build/firefox | |
| # Copy all extension files | |
| cp -r icons fonts build/firefox/ | |
| cp popup.html popup.js filepicker.html filepicker.js background.js ntfy.js styles.css build/firefox/ | |
| # Create Firefox-specific manifest (uses scripts instead of service_worker) | |
| node build-manifest.js firefox > build/firefox/manifest.json | |
| # Create XPI for Firefox (it's just a ZIP with .xpi extension) | |
| cd build/firefox | |
| zip -r ../send-to-ntfy-firefox-v${{ steps.version.outputs.version }}.xpi . | |
| # ================== | |
| # Upload Artifacts | |
| # ================== | |
| - name: Upload Chrome/Edge extension | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: chrome-edge-extension | |
| path: build/send-to-ntfy-chrome-v${{ steps.version.outputs.version }}.zip | |
| - name: Upload Firefox extension | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firefox-extension | |
| path: build/send-to-ntfy-firefox-v${{ steps.version.outputs.version }}.xpi | |
| # ================== | |
| # Create Release (on tag push) | |
| # ================== | |
| - name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| build/send-to-ntfy-chrome-v${{ steps.version.outputs.version }}.zip | |
| build/send-to-ntfy-firefox-v${{ steps.version.outputs.version }}.xpi | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |