Skip to content

Release v1.0.0

Release v1.0.0 #14

Workflow file for this run

name: Update Homebrew Tap
on:
release:
types:
- published
jobs:
update-homebrew:
runs-on: ubuntu-latest
steps:
- name: Checkout CLI repo
uses: actions/checkout@v4
- name: Wait for 5 seconds
run: sleep 5
- name: Download release artifacts
run: |
mkdir -p dist
wget -qO dist/exc-darwin-arm64.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-darwin-arm64.tar.gz"
wget -qO dist/exc-darwin-amd64.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-darwin-amd64.tar.gz"
wget -qO dist/exc-linux-arm64.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-linux-arm64.tar.gz"
wget -qO dist/exc-linux-amd64.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-linux-amd64.tar.gz"
- name: Calculate SHA256 checksums
id: checksums
run: |
echo "darwin_arm64=$(sha256sum dist/exc-darwin-arm64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV
echo "darwin_amd64=$(sha256sum dist/exc-darwin-amd64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV
echo "linux_arm64=$(sha256sum dist/exc-linux-arm64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV
echo "linux_amd64=$(sha256sum dist/exc-linux-amd64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV
- name: Checkout Homebrew Tap repo
uses: actions/checkout@v4
with:
repository: excloud-in/homebrew-excloud
token: ${{ secrets.GH_TOKEN }}
- name: Update Homebrew formula
run: |
sed -i "s/^ version \".*\"$/ version \"${{ github.event.release.tag_name }}\"/" exc.rb
sed -i "/darwin-arm64.tar.gz/{n;s/sha256 \".*\"/sha256 \"${{ env.darwin_arm64 }}\"/}" exc.rb
sed -i "/darwin-arm64.tar.gz/s|url \".*\"|url \"https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-darwin-arm64.tar.gz\"|" exc.rb
sed -i "/darwin-amd64.tar.gz/{n;s/sha256 \".*\"/sha256 \"${{ env.darwin_amd64 }}\"/}" exc.rb
sed -i "/darwin-amd64.tar.gz/s|url \".*\"|url \"https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-darwin-amd64.tar.gz\"|" exc.rb
sed -i "/linux-arm64.tar.gz/{n;s/sha256 \".*\"/sha256 \"${{ env.linux_arm64 }}\"/}" exc.rb
sed -i "/linux-arm64.tar.gz/s|url \".*\"|url \"https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-linux-arm64.tar.gz\"|" exc.rb
sed -i "/linux-amd64.tar.gz/{n;s/sha256 \".*\"/sha256 \"${{ env.linux_amd64 }}\"/}" exc.rb
sed -i "/linux-amd64.tar.gz/s|url \".*\"|url \"https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/exc-linux-amd64.tar.gz\"|" exc.rb
- name: Commit and push changes
run: |
git config user.name "GitHub Actions Bot"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add exc.rb
git commit -m "Update Homebrew formula for version ${{ github.event.release.tag_name }}"
git push