-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: workflow failure updating downstream helm charts (#398)
* fix workflow failure * update refs & outputs * prom export version * fix output ref * remove unneccessary env refs --------- Co-authored-by: jamie zieziula <[email protected]>
- Loading branch information
1 parent
b3efa68
commit 2f2bdf5
Showing
5 changed files
with
58 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -12,6 +12,8 @@ jobs: | |
permissions: | ||
# GitHub considers creating releases and uploading assets as writing contents. | ||
contents: write | ||
outputs: | ||
releaseVersion: ${{ steps.output_version.outputs.releaseVersion }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -28,11 +30,16 @@ jobs: | |
# 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_OUTPUT | ||
echo "RELEASE_VERSION=$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_ENV | ||
echo "PREFECT_VERSION=$(\ | ||
git ls-remote --tags --refs --sort="v:refname" \ | ||
https://github.com/PrefectHQ/prefect.git '[3].*.[!rc]' | tail -n1 | sed 's/.*\///' \ | ||
)" >> $GITHUB_OUTPUT | ||
)" >> $GITHUB_ENV | ||
- name: Output version as GitHub Output | ||
id: output_version | ||
run: | | ||
echo "releaseVersion=$RELEASE_VERSION" >> $GITHUB_OUTPUT | ||
- name: Copy Artifact Hub metadata | ||
run: | | ||
|
@@ -55,11 +62,11 @@ jobs: | |
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | ||
passphrase_file="$gpg_dir/passphrase" | ||
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 }} | ||
|
||
- name: Add dependency chart repos | ||
run: | | ||
|
@@ -79,11 +86,6 @@ jobs: | |
--sign --key '[email protected]' \ | ||
--keyring $SIGN_KEYRING \ | ||
--passphrase-file $SIGN_PASSPHRASE_FILE | ||
env: | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
PREFECT_VERSION: ${{ steps.get_version.outputs.PREFECT_VERSION }} | ||
SIGN_KEYRING: ${{ env.SIGN_KEYRING }} | ||
SIGN_PASSPHRASE_FILE: ${{ env.SIGN_PASSPHRASE_FILE }} | ||
- name: Package Server helm chart | ||
run: | | ||
|
@@ -99,11 +101,6 @@ jobs: | |
--sign --key '[email protected]' \ | ||
--keyring $SIGN_KEYRING \ | ||
--passphrase-file $SIGN_PASSPHRASE_FILE | ||
env: | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
PREFECT_VERSION: ${{ steps.get_version.outputs.PREFECT_VERSION }} | ||
SIGN_KEYRING: ${{ env.SIGN_KEYRING }} | ||
SIGN_PASSPHRASE_FILE: ${{ env.SIGN_PASSPHRASE_FILE }} | ||
- name: Update chart index | ||
run: | | ||
|
@@ -120,17 +117,6 @@ jobs: | |
git add ./artifacthub-repo.yml ./index.yaml ./charts/prefect-server-$RELEASE_VERSION.* ./charts/prefect-worker-$RELEASE_VERSION.* | ||
git commit -m "Release $RELEASE_VERSION" | ||
git push origin gh-pages | ||
env: | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
|
||
- name: Trigger deploy-latest-helm-version workflow | ||
run: | | ||
gh workflow run deploy-latest-helm-version.yaml \ | ||
--ref main \ | ||
-f release_version=$RELEASE_VERSION | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
- name: Create Github Release + Tag | ||
run: | | ||
|
@@ -139,6 +125,19 @@ jobs: | |
--notes "Packaged with Prefect version \ | ||
[$PREFECT_VERSION](https://github.com/PrefectHQ/prefect/releases/tag/$PREFECT_VERSION)" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
PREFECT_VERSION: ${{ steps.get_version.outputs.PREFECT_VERSION }} | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
update_helm_chart_versions_downstream: | ||
name: Update Helm Chart versions in `ops-cluster-deployment` | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run workflow | ||
run: | | ||
gh workflow run update-prefect-helm-chart-versions.yaml \ | ||
--repo prefecthq/ops-cluster-deployment \ | ||
--ref main \ | ||
-f chart_version=${{ needs.release.outputs.releaseVersion }} \ | ||
-f type=main | ||
env: | ||
GH_TOKEN: ${{ secrets.OPS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ jobs: | |
permissions: | ||
# GitHub considers creating releases and uploading assets as writing contents. | ||
contents: write | ||
outputs: | ||
releaseVersion: ${{ steps.output_version.outputs.releaseVersion }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -28,13 +30,17 @@ jobs: | |
# Enable pipefail so git command failures do not result in null versions downstream | ||
set -x | ||
echo "CHART_VERSION=$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_OUTPUT | ||
echo "RELEASE_VERSION=prometheus-prefect-exporter-$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_OUTPUT | ||
echo "RELEASE_VERSION=$(date +'%Y.%-m.%-d%H%M%S')" >> $GITHUB_ENV | ||
echo "PROMETHEUS_PREFECT_EXPORTER_VERSION=$(\ | ||
git ls-remote --tags --refs --sort="v:refname" \ | ||
https://github.com/PrefectHQ/prometheus-prefect-exporter | tail -n1 | sed 's/.*\///' \ | ||
)" >> $GITHUB_OUTPUT | ||
- name: Output version as GitHub Output | ||
id: output_version | ||
run: | | ||
echo "releaseVersion=$RELEASE_VERSION" >> $GITHUB_OUTPUT | ||
- name: Copy Artifact Hub metadata | ||
run: | | ||
mkdir -p /tmp/chart | ||
|
@@ -56,11 +62,11 @@ jobs: | |
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" | ||
passphrase_file="$gpg_dir/passphrase" | ||
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 }} | ||
|
||
- name: Package Prometheus Exporter helm chart | ||
run: | | ||
|
@@ -76,11 +82,6 @@ jobs: | |
--sign --key '[email protected]' \ | ||
--keyring $SIGN_KEYRING \ | ||
--passphrase-file $SIGN_PASSPHRASE_FILE | ||
env: | ||
CHART_VERSION: ${{ steps.get_version.outputs.CHART_VERSION }} | ||
PROMETHEUS_PREFECT_EXPORTER_VERSION: ${{ steps.get_version.outputs.PROMETHEUS_PREFECT_EXPORTER_VERSION }} | ||
SIGN_KEYRING: ${{ env.SIGN_KEYRING }} | ||
SIGN_PASSPHRASE_FILE: ${{ env.SIGN_PASSPHRASE_FILE }} | ||
- name: Update chart index | ||
run: | | ||
|
@@ -96,17 +97,6 @@ jobs: | |
git add ./artifacthub-repo.yml ./index.yaml ./charts/prometheus-prefect-exporter-$CHART_VERSION.* | ||
git commit -m "Release $CHART_VERSION" | ||
git push origin gh-pages | ||
env: | ||
CHART_VERSION: ${{ steps.get_version.outputs.CHART_VERSION }} | ||
|
||
- name: Trigger deploy-latest-helm-version workflow | ||
run: | | ||
gh workflow run deploy-latest-helm-version.yaml \ | ||
--ref main \ | ||
-f release_version=$RELEASE_VERSION | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
- name: Create Github Release + Tag | ||
run: | | ||
|
@@ -115,6 +105,19 @@ jobs: | |
--notes "Packaged with Prometheus Prefect Exporter version \ | ||
[$PROMETHEUS_PREFECT_EXPORTER_VERSION](https://github.com/PrefectHQ/prometheus-prefect-exporter/releases/tag/$PROMETHEUS_PREFECT_EXPORTER_VERSION)" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }} | ||
PROMETHEUS_PREFECT_EXPORTER_VERSION: ${{ steps.get_version.outputs.PROMETHEUS_PREFECT_EXPORTER_VERSION }} | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
update_helm_chart_version_downstream: | ||
name: Update Helm Chart version in `ops-cluster-deployment` | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run workflow | ||
run: | | ||
gh workflow run update-prefect-helm-chart-versions.yaml \ | ||
--repo prefecthq/ops-cluster-deployment \ | ||
--ref main \ | ||
-f chart_version=${{ needs.release.outputs.releaseVersion }} \ | ||
-f type=exporter | ||
env: | ||
GH_TOKEN: ${{ secrets.OPS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ repos: | |
hooks: | ||
- id: yamllint | ||
args: | ||
- --strict | ||
- --strict |