Release #83
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump_type: | |
description: 'v[major].[minor].[patch]' | |
required: true | |
type: choice | |
default: 'patch' | |
options: | |
- major | |
- minor | |
- patch | |
submit_chrome: | |
description: 'Chrome Web Store' | |
type: boolean | |
default: true | |
submit_firefox: | |
description: 'Firefox Add-ons' | |
type: boolean | |
default: true | |
jobs: | |
submit: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Setup Git | |
run: | | |
git config user.name "Midra" | |
git config user.email "[email protected]" | |
- name: Update Version | |
run: | | |
pnpm version ${{ github.event.inputs.bump_type }} | |
echo VERSION="v$(cat ./package.json | jq -r '.version')" >> "${GITHUB_ENV}" | |
- name: Zip Extensions | |
run: | | |
pnpm zip | |
pnpm zip:firefox | |
- name: Push tag to GitHub | |
run: | | |
git push | |
git push --tags | |
- name: Create Release to GitHub | |
run: | | |
gh release create "${VERSION}" \ | |
./dist/*-chrome.zip \ | |
./dist/*-firefox.zip \ | |
-t "$(cat ./package.json | jq -r '.displayName') ${VERSION}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Submit to Chrome Web Store | |
if: ${{ github.event.inputs.submit_chrome == 'true' }} | |
run: | | |
pnpm wxt submit \ | |
--chrome-zip ./dist/*-chrome.zip | |
env: | |
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }} | |
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }} | |
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }} | |
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }} | |
- name: Submit to Firefox Add-ons | |
if: ${{ github.event.inputs.submit_firefox == 'true' }} | |
run: | | |
pnpm wxt submit \ | |
--firefox-zip ./dist/*-firefox.zip \ | |
--firefox-sources-zip ./dist/*-sources.zip | |
env: | |
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} | |
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }} | |
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }} |