v4.2.2 #42
Workflow file for this run
This file contains 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
# docs: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: 🚀 Release | |
on: | |
release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release> | |
types: [published] | |
jobs: | |
build: | |
name: Build the extension | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- {uses: gacts/github-slug@v1, id: slug} | |
- {uses: actions/setup-node@v4, with: {node-version: 21, cache: 'npm'}} | |
- run: npm install | |
- run: > | |
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 Chrome Web Store | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- {uses: actions/download-artifact@v4, with: {name: chrome.zip, path: dist}} | |
- uses: mnao305/chrome-extension-upload@v5.0.0 | |
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 }} |