-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from stakpak/stakpak-1522
Feat: Add Config Files
- Loading branch information
Showing
1 changed file
with
57 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -91,4 +91,60 @@ jobs: | |
prerelease: false | ||
generate_release_notes: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
homebrew: | ||
needs: release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: stakpak/homebrew-stakpak | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update Homebrew formula | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
curl -L "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-darwin-x86_64.tar.gz" -o stakpak-darwin-x86_64.tar.gz | ||
curl -L "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-darwin-aarch64.tar.gz" -o stakpak-darwin-aarch64.tar.gz | ||
curl -L "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-linux-x86_64.tar.gz" -o stakpak-linux-x86_64.tar.gz | ||
SHA256_DARWIN_X64=$(sha256sum stakpak-darwin-x86_64.tar.gz | cut -d ' ' -f 1) | ||
SHA256_DARWIN_ARM=$(sha256sum stakpak-darwin-aarch64.tar.gz | cut -d ' ' -f 1) | ||
SHA256_LINUX_X64=$(sha256sum stakpak-linux-x86_64.tar.gz | cut -d ' ' -f 1) | ||
cat > Formula/stakpak.rb << EOF | ||
class Stakpak < Formula | ||
desc "Stakpak CLI tool" | ||
homepage "https://github.com/stakpak/stakpak" | ||
version "${VERSION}" | ||
on_macos do | ||
if Hardware::CPU.arm? | ||
url "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-darwin-aarch64.tar.gz" | ||
sha256 "${SHA256_DARWIN_ARM}" | ||
else | ||
url "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-darwin-x86_64.tar.gz" | ||
sha256 "${SHA256_DARWIN_X64}" | ||
end | ||
end | ||
on_linux do | ||
url "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/stakpak-linux-x86_64.tar.gz" | ||
sha256 "${SHA256_LINUX_X64}" | ||
end | ||
def install | ||
bin.install "stakpak" | ||
end | ||
end | ||
EOF | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
git add Formula/stakpak.rb | ||
git commit -m "Update stakpak to v${VERSION}" | ||
git push |