|
| 1 | +name: Publish to all stores |
| 2 | +on: [workflow_dispatch] |
| 3 | + |
| 4 | +jobs: |
| 5 | + setup: |
| 6 | + name: Setup and build |
| 7 | + runs-on: ubuntu-latest |
| 8 | + outputs: |
| 9 | + target-zip: ${{ steps.build.outputs.target-zip }} |
| 10 | + firefox-zip: ${{ steps.build.outputs.firefox-zip }} |
| 11 | + source-zip: ${{ steps.build.outputs.source-zip }} |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + fetch-depth: 0 |
| 16 | + |
| 17 | + - name: Setup NodeJS |
| 18 | + uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version: "v20.11.0" |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + run: npm install |
| 24 | + |
| 25 | + - name: Build for all platforms |
| 26 | + id: build |
| 27 | + run: | |
| 28 | + npm run build |
| 29 | + npm run build:firefox |
| 30 | + echo "target-zip=market_packages/target.zip" >> $GITHUB_OUTPUT |
| 31 | + echo "firefox-zip=market_packages/target.firefox.zip" >> $GITHUB_OUTPUT |
| 32 | + echo "source-zip=market_packages/target.src.zip" >> $GITHUB_OUTPUT |
| 33 | +
|
| 34 | + publish-chrome: |
| 35 | + name: Publish to Chrome Web Store |
| 36 | + needs: setup |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - uses: actions/download-artifact@v4 |
| 40 | + with: |
| 41 | + name: build-artifacts |
| 42 | + path: market_packages |
| 43 | + |
| 44 | + - name: Publish to Chrome Web Store |
| 45 | + uses: mnao305/chrome-extension-upload@v5.0.0 |
| 46 | + with: |
| 47 | + file-path: ${{ needs.setup.outputs.target-zip }} |
| 48 | + extension-id: dkdhhcbjijekmneelocdllcldcpmekmm |
| 49 | + client-id: ${{ secrets.CHROME_CLIENT_ID }} |
| 50 | + client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} |
| 51 | + refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} |
| 52 | + publish: true |
| 53 | + |
| 54 | + publish-edge: |
| 55 | + name: Publish to Edge Addons |
| 56 | + needs: setup |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + name: build-artifacts |
| 62 | + path: market_packages |
| 63 | + |
| 64 | + - name: Publish to Edge Addons |
| 65 | + uses: wdzeng/edge-addon@v2 |
| 66 | + with: |
| 67 | + zip-path: ${{ needs.setup.outputs.target-zip }} |
| 68 | + product-id: 2a99ae83-5ec8-4ad2-aa63-9a276fc708ce |
| 69 | + client-id: ${{ secrets.EDGE_CLIENT_ID }} |
| 70 | + api-key: ${{ secrets.EDGE_API_KEY }} |
| 71 | + upload-only: false |
| 72 | + |
| 73 | + publish-firefox: |
| 74 | + name: Publish to Firefox Addons |
| 75 | + needs: setup |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + name: build-artifacts |
| 81 | + path: market_packages |
| 82 | + |
| 83 | + - name: Publish to Firefox Addons |
| 84 | + uses: wdzeng/firefox-addon@v1.2.0-alpha.0 |
| 85 | + with: |
| 86 | + addon-guid: "{a8cf72f7-09b7-4cd4-9aaa-7a023bf09916}" |
| 87 | + xpi-path: ${{ needs.setup.outputs.firefox-zip }} |
| 88 | + source-file-path: ${{ needs.setup.outputs.source-zip }} |
| 89 | + compatibility: firefox, android |
| 90 | + jwt-issuer: ${{ secrets.FIREFOX_JWD_ISSUER }} |
| 91 | + jwt-secret: ${{ secrets.FIREFOX_JWD_SECRET }} |
0 commit comments