From f1267366c4a8eaaa83eb64ac6b61dca692d12ad3 Mon Sep 17 00:00:00 2001 From: Faeka Ansari Date: Fri, 29 Nov 2024 01:26:29 +0530 Subject: [PATCH] add update-homebrew-formula job to release workflow Signed-off-by: Faeka Ansari --- .github/workflows/release.yaml | 39 +++++++++++++++++++ .../15-release-procedures.md | 23 ----------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 531d2d1b6..74ede3f89 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -333,3 +333,42 @@ jobs: base64-subjects: "${{ needs.combine_hashes.outputs.hashes }}" upload-assets: true # Optional: Upload to a new release provenance-name: kargo-cli.intoto.jsonl + update-homebrew-formula: + if: github.event_name == 'release' + permissions: + contents: write # Needed to push changes + pull-requests: write # Needed to create a pull request + runs-on: ubuntu-latest + needs: [ publish-image, publish-cli ] + steps: + - name: Checkout bottle Repository + uses: actions/checkout@v4 + with: + repository: akuity/homebrew-tap + token: ${{ secrets.GITHUB_TOKEN }} + path: homebrew-tap + + - name: Update Homebrew formula + run: | + cd homebrew-tap + ./update.sh kargo ${{ github.ref_name }} + + - name: Configure Git and Commit changes + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + cd homebrew-tap + git checkout -b update-kargo-${{ github.ref_name }} + git add kargo.rb + git commit -m "chore: update Kargo cli to version ${{ github.ref_name }}" + + - name: Push changes and open PR + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Update Kargo formula to version ${{ github.ref_name }}" + branch: update-kargo-${{ github.ref_name }} + base: main + title: "chore: update Kargo formula to version ${{ github.ref_name }}" + body: "This PR updates the Homebrew formula for Kargo to version ${{ github.ref_name }}." + delete-branch: 'true' diff --git a/docs/docs/40-contributor-guide/15-release-procedures.md b/docs/docs/40-contributor-guide/15-release-procedures.md index cceb615ad..eab00608f 100644 --- a/docs/docs/40-contributor-guide/15-release-procedures.md +++ b/docs/docs/40-contributor-guide/15-release-procedures.md @@ -154,29 +154,6 @@ release date -- which is always a Friday. [automated release process](https://github.com/akuity/kargo/actions/workflows/release.yaml) to complete. -1. Update [Homebrew Formula](https://github.com/akuity/homebrew-tap). - - * Clone the Homebrew tap repository: - ```bash - git clone https://github.com/akuity/homebrew-tap.git - cd homebrew-tap - ``` - * Run the update script with the new version: - ```bash - ./update.sh kargo vM.m.0 - ``` - * Verify the updated formula: - ```bash - brew install --build-from-source ./kargo.rb - kargo --version - ``` - * Commit and push the changes to the Homebrew tap repository: - ```bash - git add kargo.rb - git commit -m "Update Kargo formula to version vM.m.0" - git push origin main - ``` - 1. Mark the release branch (`release-M.m`) as the __"Production branch"__ [in Netlify](https://app.netlify.com/sites/docs-kargo-akuity-io/configuration/deploys#branches-and-deploy-contexts).