Files
2025-02-14 00:16:38 +00:00

82 lines
2.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

env:
DIRECTORY: distribution
# FILE GENERATED WITH: npx ghat fregante/ghatemplates/webext
# SOURCE: https://github.com/fregante/ghatemplates
# OPTIONS: {"exclude":["on.schedule"]}
name: Release
on:
workflow_dispatch: null
jobs:
Version:
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: install
run: npm ci || npm install
- run: npm test
- uses: fregante/daily-version-action@v2
name: Create tag if necessary
id: daily-version
- if: steps.daily-version.outputs.created
name: Create release
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: >
await github.request(`POST /repos/${{ github.repository
}}/releases`, {
tag_name: "${{ steps.daily-version.outputs.version }}",
generate_release_notes: true
});
Submit:
needs: Version
if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created
strategy:
fail-fast: false
matrix:
command:
- firefox
- chrome
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: install
run: npm ci || npm install
- run: npm run build --if-present
- name: Update extensions meta
run: >-
npx dot-json@1 $DIRECTORY/manifest.json version ${{
needs.Version.outputs.version }}
- name: Submit
run: |
case ${{ matrix.command }} in
chrome)
cd $DIRECTORY && npx chrome-webstore-upload-cli@2 upload --auto-publish
;;
firefox)
cd $DIRECTORY && npx web-ext-submit@7
;;
esac
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}