Skip to content

Commit

Permalink
ACTIONS-UPGRADE Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hrai committed Jan 30, 2024
1 parent 76dca51 commit 6366ddf
Showing 1 changed file with 80 additions and 79 deletions.
159 changes: 80 additions & 79 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,94 @@
# 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
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:
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 }}"
- 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:
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
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
- 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:
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:
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: |
run: |
yarn update-version:${{ matrix.command }}
- run: yarn release:${{ matrix.command }}
env:
- 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 }}'
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 }}'

0 comments on commit 6366ddf

Please sign in to comment.