-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: 👷 Publish on chrome/mozilla web stores automatically
- Loading branch information
1 parent
1edc7f9
commit 290881f
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} |