Skip to content

Release

Release #252

Workflow file for this run

# Copied from https://github.com/fregante/browser-extension-template/blob/main/.github/workflows/release.yml
name: Release
on:
workflow_dispatch:
# You can manually trigger a deployment on github.com
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
schedule:
- cron: '30 10 * * 1' #https://crontab.guru/#30_10_*_*_1
jobs:
Version:
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
- run: yarn install
- run: yarn test
- uses: fregante/daily-version-action@v2
name: Create tag if necessary
id: daily-version
# - name: Created?
# if: steps.version.outputs.created
# runs: echo "Created ${{ steps.version.outputs.version }}"
- if: steps.daily-version.outputs.created
name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release create "${{ steps.daily-version.outputs.version }}"
Build-and-upload-artifacts:
needs: Version
if: github.event_name == 'push' || needs.Version.outputs.created
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
command:
- firefox
- chrome
steps:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: yarn install, build, and test
run: |
yarn build
yarn test
- name: Update extension’s meta
env:
VER: ${{ needs.Version.outputs.version }}
run: |
yarn update-version:${{ matrix.command }}
- uses: actions/upload-artifact@v2
with:
path: distribution
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@v2
- run: yarn install
- run: yarn build
- name: Update extension’s meta
env:
VER: ${{ needs.Version.outputs.version }}
run: |
yarn update-version:${{ matrix.command }}
- run: yarn release:${{ matrix.command }}
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 }}'
WEB_EXT_ID: '${{ secrets.WEB_EXT_ID }}'