Generate release with assets & publish on addons stores #34
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: "Generate release with assets & publish on addons stores" | |
| on: | |
| workflow_dispatch | |
| jobs: | |
| build: | |
| environment: webstores-publishing | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Cache pnpm modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}- | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: true | |
| - name: Use Node.js 20.x LTS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: "pnpm" | |
| - name: Get current package.json version | |
| id: package-version | |
| uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
| - name: Build Firefox extension | |
| run: | | |
| pnpm plasmo build --target=firefox-mv2 --zip | |
| mv build/firefox-mv2-prod.zip firefox-addon-${{ steps.package-version.outputs.current-version }}.zip | |
| - name: Build Chrome(-ium) extension | |
| run: | | |
| pnpm plasmo build --target=chrome-mv3 --zip | |
| mv build/chrome-mv3-prod.zip chromium-addon-${{ steps.package-version.outputs.current-version }}.zip | |
| #- name: Browser Platform Publisher | |
| # uses: PlasmoHQ/bpp@v3.5.0 | |
| # with: | |
| # keys: ${{ secrets.SUBMIT_KEYS }} | |
| # verbose: true | |
| - name: Generate release | |
| uses: ncipollo/release-action@v1.16.0 | |
| id: release-action | |
| with: | |
| bodyFile: "CHANGELOG.md" | |
| commit: "master" | |
| tag: ${{ steps.package-version.outputs.current-version }} | |
| draft: true | |
| generateReleaseNotes: true | |
| makeLatest: true | |
| - name: Upload release assets | |
| uses: AButler/upload-release-assets@v3.0 | |
| with: | |
| files: "firefox-addon-${{ steps.package-version.outputs.current-version }}.zip;chromium-addon-${{ steps.package-version.outputs.current-version }}.zip" | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| release-id: ${{ steps.release-action.outputs.id }} | |