Skip to content

Commit

Permalink
ci: 👷 Publish on chrome/mozilla web stores automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam committed May 16, 2024
1 parent 1edc7f9 commit 290881f
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,55 @@ jobs:
npm version --no-git-tag-version
"${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}.${{ steps.slug.outputs.version-patch }}"
- run: npm run build
- uses: actions/upload-artifact@v4
with: {name: chrome.zip, path: ./dist/chrome.zip, if-no-files-found: error, retention-days: 7}
- uses: actions/upload-artifact@v4
with: {name: firefox.zip, path: ./dist/firefox.zip, if-no-files-found: error, retention-days: 7}

upload-to-release:
name: Upload to release
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: chrome.zip, path: dist}}
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/chrome.zip
asset_name: random-user-agent-chrome.zip
tag: ${{ github.ref }}
- {uses: actions/download-artifact@v4, with: {name: firefox.zip, path: dist}}
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/firefox.zip
asset_name: random-user-agent-firefox.zip
tag: ${{ github.ref }}

chrome:
name: Publish on the Chrome Web Store
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: chrome.zip, path: dist}}
- uses: mnao305/[email protected]
with:
file-path: dist/chrome.zip
extension-id: einpaelgookohagofgnnkcfjbkkgepnp
client-id: ${{ secrets.CHROME_WEBSTORE_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_WEBSTORE_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_WEBSTORE_REFRESH_TOKEN }}
publish: false

mozilla:
name: Publish on Mozilla Add-ons
runs-on: ubuntu-latest
needs: [build]
steps:
- {uses: actions/download-artifact@v4, with: {name: firefox.zip, path: dist}}
- uses: wdzeng/firefox-addon@v1
with:
addon-guid: '{b43b974b-1d3a-4232-b226-eaa2ac6ebb69}'
xpi-path: dist/firefox.zip
jwt-issuer: ${{ secrets.MOZILLA_ADDONS_JWT_ISSUER }}
jwt-secret: ${{ secrets.MOZILLA_ADDONS_JWT_SECRET }}

0 comments on commit 290881f

Please sign in to comment.