-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
79 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,91 @@ | ||
# 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 }}" | ||
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: [18.x] | ||
command: | ||
- firefox | ||
- chrome | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: yarn install --frozen-lockfile | ||
Build-and-upload-artifacts: | ||
needs: Version | ||
if: github.event_name == 'push' || needs.Version.outputs.created | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.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 | ||
- 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 }}' | ||
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 }}' |