Skip to content

Commit

Permalink
ci: Ensure ci-imgs repo is only triggered when new releases occur (#63
Browse files Browse the repository at this point in the history
)

The `release.yaml` workflow currently triggers the `ci-imgs` repository
to rebuild anytime a merge to `main` happens.

This PR makes the logic smarter by only triggering the `ci-imgs`
repository to rebuild when an actual release occurs.

This will prevent `ci-imgs` rebuilds from occurring unnecessarily.
  • Loading branch information
ajschmidt8 authored Dec 14, 2023
1 parent c7222f4 commit 6a6a6b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
outputs:
RELEASE_PUBLISHED: ${{ steps.semantic-release.outputs.RELEASE_PUBLISHED }}
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
Expand All @@ -24,13 +26,15 @@ jobs:
with:
node-version: "lts/*"
- name: Release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
run: |
npm install
npx semantic-release
trigger-pipeline:
if: needs.release.outputs.RELEASE_PUBLISHED == 'true'
runs-on: ubuntu-latest
needs: release
steps:
Expand Down
1 change: 1 addition & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins:
- - "@semantic-release/exec"
- verifyReleaseCmd: ./ci/update-versions.sh ${nextRelease.version} && ./ci/build-test.sh
publishCmd: ./ci/pypi-publish.sh
successCmd: ./ci/semantic-release-success.sh
- - "@semantic-release/git"
- assets:
- src/rapids_dependency_file_generator/_version.py
Expand Down
4 changes: 4 additions & 0 deletions ci/semantic-release-success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail

echo "RELEASE_PUBLISHED=true" | tee --append "${GITHUB_OUTPUT:-/dev/null}"

0 comments on commit 6a6a6b1

Please sign in to comment.