diff --git a/.github/workflows/deploy-latest-helm-version.yaml b/.github/workflows/deploy-latest-helm-version.yaml deleted file mode 100644 index d269c07b..00000000 --- a/.github/workflows/deploy-latest-helm-version.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Deploy Latest Helm Releases to Internal Cluster - -"on": - workflow_dispatch: - inputs: - release_version: - description: The latest release tag - required: true - -permissions: {} - -jobs: - update_helm_releases: - runs-on: ubuntu-latest - steps: - - name: Sleep for 3 minutes to allow time for the helm package to be available - run: sleep 180s - shell: bash - - - name: update helm releases - run: | - gh workflow run updatecli-helm-integration-tests.yaml \ - --repo prefecthq/ops-cluster-deployment \ - --ref main \ - -f release_version=${{ github.event.inputs.release_version }} - env: - GH_TOKEN: ${{ secrets.OPS_CLUSTER_DEPLOYMENT_ACTIONS_RW }} diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index b4b41b3c..26b554f7 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -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 'jamie@prefect.io' \ --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 'jamie@prefect.io' \ --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 }} diff --git a/.github/workflows/notify-on-failure.yaml b/.github/workflows/notify-on-failure.yaml index 87d63857..59b2e0af 100644 --- a/.github/workflows/notify-on-failure.yaml +++ b/.github/workflows/notify-on-failure.yaml @@ -4,7 +4,6 @@ name: Notify on Failure "on": workflow_run: workflows: - - Deploy Latest Helm Releases to Internal Cluster - Release Prefect Server and Worker Helm Charts - Release Prometheus Prefect Exporter Helm Chart - Updatecli Major Dependency Updates diff --git a/.github/workflows/prometheus-exporter-helm-release.yaml b/.github/workflows/prometheus-exporter-helm-release.yaml index 42507b59..a2765ac7 100644 --- a/.github/workflows/prometheus-exporter-helm-release.yaml +++ b/.github/workflows/prometheus-exporter-helm-release.yaml @@ -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 'jamie@prefect.io' \ --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 }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3dd775de..d93e3900 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,4 +38,4 @@ repos: hooks: - id: yamllint args: - - --strict \ No newline at end of file + - --strict