forked from smithy-lang/smithy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update brew workflow to use new smithy tap (smithy-lang#1897)
Updates the cli brew update workflow to use the new smithy-lang tap instead of aws/tap. The workflow is also updated to avoid the need for maintaining a repository fork and to use the github cli directly for creating a pull request.
- Loading branch information
1 parent
1989719
commit 4b2a7d1
Showing
1 changed file
with
12 additions
and
18 deletions.
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 |
---|---|---|
|
@@ -60,7 +60,7 @@ jobs: | |
- name: Checkout bottle repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'aws/homebrew-tap' | ||
repository: 'smithy-lang/homebrew-tap' | ||
path: 'homebrew-tap' | ||
ref: 'master' | ||
- name: Update version | ||
|
@@ -97,26 +97,20 @@ jobs: | |
sha=$(cut -d " " -f1 ${{steps.download.outputs.download-path}}/smithy-cli-linux-aarch64.tar.gz.sha256) | ||
tmp=$(mktemp) | ||
jq --arg sha "$sha" '.bottle.sha256.linux_arm = "'$sha'"' homebrew-tap/bottle-configs/smithy-cli.json > "$tmp" && mv "$tmp" homebrew-tap/bottle-configs/smithy-cli.json | ||
- name: Create commits | ||
- name: Set up new git branch for version bump | ||
run: | | ||
cd homebrew-tap | ||
git config user.name 'smithy-automation' | ||
git config user.email '[email protected]' | ||
git checkout -b "automation/bump-smithy-cli-version/${GITHUB_REF##*/}" | ||
- name: Create PR | ||
run: | | ||
git add bottle-configs/smithy-cli.json | ||
git commit -m "chore: upgrade smithy-cli to ${GITHUB_REF##*/}" | ||
- name: Set pull-request variables | ||
id: vars | ||
run: | | ||
echo version="${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | ||
echo pr_title="chore: upgrade smithy-cli to ${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | ||
echo pr_body="Created by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT | ||
- name: Create pull-request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
path: homebrew-tap | ||
delete-branch: true | ||
push-to-fork: smithy-automation/homebrew-tap | ||
title: ${{ steps.vars.outputs.pr_title }} | ||
body: ${{ steps.vars.outputs.pr_body }} | ||
branch: "upgrade-smithy-cli-${{ steps.vars.outputs.version }}" | ||
token: ${{ secrets.PR_TOKEN }} | ||
git push --set-upstream origin "automation/bump-smithy-cli-version/${GITHUB_REF##*/}" | ||
gh pr create \ | ||
--title "[Automation] chore: upgrade smithy-cli to ${GITHUB_REF##*/}" \ | ||
--body "Created by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \ | ||
--base main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PR_TOKEN }} |