Upload Release Asset #2
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: "Upload Release Asset" | |
on: | |
workflow_dispatch: | |
release: | |
types: [created, edited] | |
jobs: | |
get-release: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-release.outputs.version }} | |
upload_url: ${{ steps.get-release.outputs.upload_url }} | |
steps: | |
- uses: monkeyWie/[email protected] | |
id: get-release | |
with: | |
myToken: ${{ github.token }} | |
asset: | |
runs-on: ubuntu-latest | |
needs: [get-release] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache pnpm modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}- | |
- uses: pnpm/[email protected] | |
with: | |
version: latest | |
run_install: true | |
- name: Use Node.js 16.x | |
uses: actions/[email protected] | |
with: | |
node-version: 16.x | |
cache: "pnpm" | |
- name: Build the extension | |
run: | | |
pnpm build --target=chrome-mv3 | |
pnpm build --target=firefox-mv2 | |
- name: Upload | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.get-release.outputs.tag_name }} | |
files: | | |
build/chrome-mv3-prod.zip | |
build/firefox-mv2-prod.zip |