Skip to content

Commit

Permalink
Add actions to publish the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfou committed Jun 15, 2024
1 parent 7bab1b1 commit 4c1fc04
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
cache: yarn
cache-dependency-path: ./yarn.lock

- name: Install deps
run: yarn install --frozen-lockfile

- name: Build extension
run: yarn build

- name: Save extension
id: cache-extention
uses: actions/cache@v4
with:
path: public/web-ext-artifacts
key: extension-${{ github.run_id }}

publish-firefox:
name: Publish Firefox
timeout-minutes: 10
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
cache: yarn
cache-dependency-path: ./yarn.lock

- name: Install deps
run: yarn install --frozen-lockfile

- name: Restore extension
id: cache-extention
uses: actions/cache@v4
with:
path: public/build
key: extension-${{ github.run_id }}

- name: Publish
run: yarn web-ext-submit

publish-chrome:
name: Publish Chrome
timeout-minutes: 10
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.13.1
cache: yarn
cache-dependency-path: ./yarn.lock

- name: Install deps
run: yarn install --frozen-lockfile

- name: Restore extension
id: cache-extention
uses: actions/cache@v4
with:
path: public/build
key: extension-${{ github.run_id }}

- name: Publish
run: yarn chrome-webstore-upload upload --source "web-ext-artifacts/conventional_comments-${GITHUB_REF:1}.zip" --auto-publish

create-release:
name: Create Release
timeout-minutes: 10
runs-on: ubuntu-latest
needs: [publish-firefox, publish-chrome]
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Restore extension
id: cache-extention
uses: actions/cache@v4
with:
path: public/build
key: extension-${{ github.run_id }}

- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "web-ext-artifacts/*.zip"

0 comments on commit 4c1fc04

Please sign in to comment.