Submit for Review #17
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
name: Submit for Review | |
on: | |
workflow_dispatch: | |
inputs: | |
dryRun: | |
default: false | |
type: boolean | |
description: Skip submission and perform a dry run | |
jobs: | |
validate: | |
name: Validate | |
uses: ./.github/workflows/validate.yml | |
secrets: inherit | |
tests: | |
name: Tests | |
uses: ./.github/workflows/tests.yml | |
secrets: inherit | |
submit: | |
name: Submit | |
runs-on: ubuntu-22.04 | |
needs: [validate, tests] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: "./package-lock.json" | |
- name: Configure Git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
- name: Install dependencies | |
run: npm ci | |
- name: Bump Version | |
id: version | |
run: | | |
npx changelogen@latest --dir ./packages/syncwatch-extension --bump | |
NEW_VERSION=$(node -pe 'require("./packages/syncwatch-extension/package.json").version') | |
echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT" | |
- name: Build and Zip | |
run: | | |
npm run zip -w syncwatch-extension | |
npm run zip:firefox -w syncwatch-extension | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./packages/syncwatch-extension/.output/*.zip | |
if-no-files-found: error | |
include-hidden-files: true | |
- name: Submit | |
run: | | |
npx wxt submit \ | |
--chrome-zip ./packages/syncwatch-extension/.output/*-chrome.zip \ | |
--firefox-zip ./packages/syncwatch-extension/.output/*-firefox.zip \ | |
--firefox-sources-zip ./packages/syncwatch-extension/.output/*-sources.zip | |
env: | |
DRY_RUN: ${{ inputs.dryRun }} | |
CHROME_EXTENSION_ID: ${{ secrets.GOOGLE_EXTENSION_ID }} | |
CHROME_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | |
CHROME_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
CHROME_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }} | |
CHROME_SKIP_SUBMIT_REVIEW: true | |
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} | |
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_API_KEY }} | |
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_CLIENT_SECRET}} | |
- name: Commit and Push | |
if: ${{ !inputs.dryRun }} | |
run: | | |
git add package.json | |
git commit -am "chore(release): v$NEW_VERSION" | |
git tag v$NEW_VERSION | |
git push | |
git push --tags | |
env: | |
NEW_VERSION: ${{ steps.version.outputs.newVersion }} | |
- name: Release | |
if: ${{ !inputs.dryRun }} | |
run: gh release create v${{ steps.version.outputs.newVersion }} ./packages/syncwatch-extension/.output/*.zip -F ./packages/syncwatch-extension/CHANGELOG.md | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |