Skip to content

Commit

Permalink
Add release watchdog (#1192)
Browse files Browse the repository at this point in the history
* Add a release watchdog

* Move timeout to step

* Update release.yml

* Update release.yml

* Update release.yml

* Update release.yml

* Update release.yml

ens
  • Loading branch information
0x2b3bfa0 committed Sep 30, 2022
1 parent b9226f1 commit 1e081f3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
on: workflow_call
on:
workflow_call:
inputs:
release:
required: true
type: boolean
jobs:
images:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -89,7 +94,7 @@ jobs:
- uses: docker/build-push-action@v2
with:
push:
${{ github.event_name == 'push' || github.event_name == 'schedule'
${{ inputs.release || github.event_name == 'push' || github.event_name == 'schedule'
|| github.event_name == 'workflow_dispatch' }}
context: ./
file: ./Dockerfile
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
git config --global user.name Olivaw[bot]
git config --global user.email [email protected]
git checkout -b bump/$(npm version ${{ github.event.inputs.bump }})
git push --set-upstream origin --follow-tags HEAD
git push --set-upstream origin HEAD
gh pr create --title "Bump version to $(git describe --tags)" --body "Approve me 🤖"
gh pr merge --auto --squash
env:
Expand All @@ -30,12 +30,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run:
gh release create --draft --generate-notes {--title=CML\ ,}$(basename
${{ github.head_ref }})
- run: >
gh release create
--target ${{ github.event.pull_request.merge_commit_sha }}
{--title=CML\ ,}$(basename ${{ github.head_ref }})
--generate-notes
--draft
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
package:
needs: release
secrets: inherit
uses: ./.github/workflows/test-deploy.yml
with:
release: true
11 changes: 8 additions & 3 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
pull_request_target:
workflow_dispatch:
workflow_call:
inputs:
release:
required: true
type: boolean
schedule:
- cron: '0 8 * * 1' # M H d m w (Mondays at 8:00)
jobs:
Expand Down Expand Up @@ -98,8 +102,7 @@ jobs:
registry-url: https://registry.npmjs.org
- run: npm install
- run:
npm ${{ github.event_name == 'workflow_call' && 'publish' || 'publish
--dry-run' }}
npm ${{ inputs.release && 'publish' || 'publish --dry-run' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: install ldid
Expand All @@ -120,7 +123,7 @@ jobs:
cp build/cml-linux{-x64,}
cp build/cml-macos{-x64,}
- uses: softprops/action-gh-release@v1
if: github.event_name == 'workflow_call'
if: inputs.release
with:
files: |
build/cml-alpine-arm64
Expand All @@ -141,3 +144,5 @@ jobs:
needs: packages
secrets: inherit
uses: ./.github/workflows/images.yml
with:
release: ${{ inputs.release }}

0 comments on commit 1e081f3

Please sign in to comment.