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 e983080 commit 970d959
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/release.yml
@@ -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 @@ -87,7 +78,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 @@ -140,7 +130,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 @@ -185,7 +174,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 @@ -212,5 +200,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 970d959

Please sign in to comment.