-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update release workflow to support the build of a dev
chart
#115
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,22 @@ | |
name: Release Prefect Operator Helm Chart | ||
|
||
"on": | ||
workflow_dispatch: {} | ||
workflow_call: {} | ||
workflow_call: | ||
inputs: | ||
mode: | ||
description: which CI/CD mode? | ||
type: string | ||
required: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
release: | ||
name: Release Helm Chart | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# GitHub considers creating releases and uploading assets as writing contents. | ||
contents: write | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releaseVersion: ${{ steps.output_versions.outputs.releaseVersion }} | ||
operatorVersion: ${{ steps.output_versions.outputs.operatorVersion }} | ||
|
@@ -29,15 +34,28 @@ jobs: | |
- name: Get the version tags | ||
id: get_version | ||
run: | | ||
# Enable pipefail so git command failures do not result in null versions downstream | ||
set -x | ||
echo "RELEASE_VERSION=$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_ENV | ||
# Exit if any commands fail, so git command failures do not result in null versions downstream | ||
set -e | ||
if [ "${{ inputs.mode }}" == "main-merge" ]; then | ||
# append "-dev" to the version so that it's clear that this is a development release | ||
echo "RELEASE_VERSION=$(date +'%Y.%-m.%-d%H%M%S')-dev" >> $GITHUB_ENV | ||
|
||
# get the short sha of the latest commit for the operator image | ||
short_sha="$(git rev-parse --short=7 HEAD)" | ||
echo "SHORT_SHA=$short_sha" >> "$GITHUB_ENV" | ||
|
||
elif [[ "${{ inputs.mode }}" == "release" ]]; then | ||
echo "RELEASE_VERSION=$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_ENV | ||
|
||
# This ensures that the latest tag we grab will be of the operator image, and not the helm chart | ||
echo "OPERATOR_VERSION=$(\ | ||
git ls-remote --tags --refs --sort="v:refname" \ | ||
origin 'v[0-9].[0-9].[0-9]' | tail -n1 | sed 's/.*\///' | ||
)" >> $GITHUB_ENV | ||
# This ensures that the latest tag we grab will be of the operator image, and not the helm chart | ||
echo "OPERATOR_VERSION=$(\ | ||
git ls-remote --tags --refs --sort="v:refname" \ | ||
origin 'v[0-9].[0-9].[0-9]' | tail -n1 | sed 's/.*\///' | ||
)" >> $GITHUB_ENV | ||
else | ||
echo "Invalid mode: ${{ inputs.mode }}" | ||
exit 1 | ||
fi | ||
|
||
- name: Output versions as GitHub Outputs | ||
id: output_versions | ||
|
@@ -63,11 +81,11 @@ jobs: | |
passphrase_file="$gpg_dir/passphrase" | ||
# store passphrase in a file | ||
echo "$GPG_PASSPHRASE" > "$passphrase_file" | ||
echo "SIGN_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" | ||
echo "SIGN_KEYRING=$keyring" >> "$GITHUB_ENV" | ||
echo "SIGN_PASSPHRASE_FILE=$passphrase_file" >> $GITHUB_ENV | ||
echo "SIGN_KEYRING=$keyring" >> $GITHUB_ENV | ||
env: | ||
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" | ||
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" | ||
GPG_KEYRING_BASE64: ${{ secrets.GPG_KEYRING_BASE64 }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
Comment on lines
+84
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing quotes, should be a no-op |
||
|
||
- name: Add dependency chart repos | ||
run: | | ||
|
@@ -119,11 +137,12 @@ jobs: | |
steps: | ||
- name: Run workflow | ||
run: | | ||
gh workflow run update-prefect-operator-versions.yaml \ | ||
gh workflow run update-operator-versions.yaml \ | ||
--repo prefecthq/cloud2-cluster-deployment \ | ||
--ref main \ | ||
-f image_version=${{ needs.release.outputs.operatorVersion }} \ | ||
-f chart_version=${{ needs.release.outputs.releaseVersion }} \ | ||
-f mode=release | ||
-f mode=${{ inputs.mode }} \ | ||
-f operator=prefect-operator | ||
env: | ||
GH_TOKEN: ${{ secrets.CLOUD2_CLUSTER_DEPLOYMENT_ACTIONS_RW }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ jobs: | |
- "1.28.0" | ||
- "1.29.0" | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for workflow_dispatch anymore -- since we will be building dev charts on every merge to main