Release #33
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
| 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@v3 | |
| with: | |
| fetch-depth: 20 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.6.5 | |
| - name: Use Node.js from .nvmrc | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: install | |
| run: pnpm install --frozen-lockfile | |
| - run: pnpm test | |
| - uses: fregante/daily-version-action@v2 | |
| name: Create tag if necessary | |
| id: daily-version | |
| - uses: notlmn/release-with-changelog@v3 | |
| if: steps.daily-version.outputs.created | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| exclude: 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@v3 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.6.5 | |
| - name: Use Node.js from .nvmrc | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build extension | |
| run: | | |
| case ${{ matrix.command }} in | |
| chrome) | |
| pnpm build | |
| ;; | |
| firefox) | |
| pnpm build:firefox | |
| ;; | |
| esac | |
| - name: Update extension's 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 [email protected] upload --auto-publish | |
| ;; | |
| firefox) | |
| cd $DIRECTORY && npx web-ext-submit@5 | |
| ;; | |
| 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 }} |