Skip to content

Commit 5bcdfd8

Browse files
ci: homebrew support
1 parent 8a367a3 commit 5bcdfd8

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,31 @@ jobs:
7676

7777
- name: Upload release assets
7878
run: gh release upload "${{ github.ref_name }}" createos-* --clobber
79+
80+
update-tap:
81+
needs: release
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
repository: NodeOps-app/homebrew-tap
87+
token: ${{ secrets.TAP_GITHUB_TOKEN }}
88+
89+
- name: Update formula
90+
run: |
91+
VERSION="${{ github.ref_name }}"
92+
VERSION_NUM="${VERSION#v}"
93+
94+
ARM64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-darwin-arm64.sha256")
95+
AMD64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-darwin-amd64.sha256")
96+
97+
sed -i "s/version \".*\"/version \"${VERSION_NUM}\"/" Formula/createos.rb
98+
sed -i "/on_arm/,/end/{s/sha256 \".*\"/sha256 \"${ARM64_SHA}\"/}" Formula/createos.rb
99+
sed -i "/on_intel/,/end/{s/sha256 \".*\"/sha256 \"${AMD64_SHA}\"/}" Formula/createos.rb
100+
sed -i "s|releases/download/v[^/]*/|releases/download/${VERSION}/|g" Formula/createos.rb
101+
102+
git config user.name "github-actions"
103+
git config user.email "github-actions@github.com"
104+
git add Formula/createos.rb
105+
git commit -m "Update createos to ${VERSION}"
106+
git push

0 commit comments

Comments
 (0)