Optimize release workflow by adding caching for Node modules and rest… #5
This file contains hidden or 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: Main | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ github.ref_name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Node Modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: yarn install | |
- name: Build extension | |
run: | | |
yarn build --zip | |
yarn build --target=firefox-mv3 --zip | |
yarn build --target=edge-mv3 --zip | |
yarn build --target=brave-mv3 --zip | |
yarn build --target=opera-mv3 --zip | |
yarn build --target=safari-mv3 --zip | |
- name: Generate Changelog | |
run: echo "# Good things have arrived" > ${{ github.workspace }}-CHANGELOG.txt | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
build/chrome-mv3-${{ env.VERSION }}.zip | |
build/edge-mv3-${{ env.VERSION }}.zip | |
build/brave-mv3-${{ env.VERSION }}.zip | |
build/opera-mv3-${{ env.VERSION }}.zip | |
build/safari-mv3-${{ env.VERSION }}.zip |