Skip to content

Commit

Permalink
fix(cd): remove workflow_run trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias committed Oct 28, 2022
1 parent 2fc180c commit f54fcc5
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: CD
on:
workflow_run:
workflows:
- CI
branches: [main, beta]
types:
- completed
schedule:
- cron: 0 1 * * * # every night at 1am on dev
workflow_dispatch:
Expand All @@ -18,14 +12,12 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WIN_CSC_LINK: ${{ github.workspace }}/certwin.p12
CSC_LINK: ${{ github.workspace }}/certmac.p12
GITHUB_REF_OVERRIDE: ${{ github.event.workflow_run.conclusion == 'success' && format('refs/heads/{0}', github.event.workflow_run.head_branch) || github.ref }}

jobs:
compile:
name: Compile
runs-on: ubuntu-latest
if: "${{ github.event.workflow_run.conclusion == 'success' }}
|| ${{ github.event_name == 'schedule'}}
if: "${{ github.event_name == 'schedule'}}
|| (${{ github.event_name == 'workflow_dispatch' }} && contains('refs/heads/main,refs/heads/beta,refs/heads/dev', github.ref))"
outputs:
current-version: ${{ steps.compile.outputs.current-version }}
Expand All @@ -35,7 +27,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.GITHUB_REF_OVERRIDE }}
- name: Decode certificates
env:
WIN_CSC_LINK_RAW: ${{ secrets.WIN_CSC_LINK }}
Expand Down Expand Up @@ -89,7 +80,6 @@ jobs:
export PATH="$(pwd)/.github/bin/:$PATH"
# override because of "env-ci" used by semantic-release
# GITHUB_REF should not be default branch when "workflow_run" event is triggered
export GITHUB_REF=$GITHUB_REF_OVERRIDE
echo "current-version=$(node -e "console.log(require('./package.json').version)")" >> $GITHUB_OUTPUT
yarn semantic-release
echo "next-version=$(node -e "console.log(require('./package.json').version)")" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -144,7 +134,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.GITHUB_REF_OVERRIDE }}
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
Expand Down Expand Up @@ -189,7 +178,6 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ env.GITHUB_REF_OVERRIDE }}
- name: Download all dist form build jobs
uses: actions/download-artifact@v2
with:
Expand All @@ -216,5 +204,4 @@ jobs:
- name: Semantic Release
run: |
export PATH="$(pwd)/.github/bin/:$PATH"
export GITHUB_REF=$GITHUB_REF_OVERRIDE
yarn semantic-release

0 comments on commit f54fcc5

Please sign in to comment.