CLI v3.1.1 #28
Workflow file for this run
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
# Update cli manifest in geode-sdk/homebrew-geode | |
# TODO: update the winget one too :P | |
name: Update CLI Manifests | |
on: | |
# trigger when a new release is released | |
release: | |
types: | |
- released | |
workflow_dispatch: | |
jobs: | |
trigger: | |
name: Update homebrew repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout homebrew tap | |
uses: actions/checkout@v4 | |
with: | |
repository: geode-sdk/homebrew-geode | |
path: homebrew-geode | |
token: ${{ secrets.GEODE_BOT_PUSH_BIN_TOKEN }} | |
- name: Fetch release info | |
uses: actions/github-script@v6 | |
id: fetch-mac-release | |
with: | |
result-encoding: string | |
script: | | |
let rel = await github.rest.repos.getLatestRelease({ | |
owner: 'geode-sdk', | |
repo: 'cli', | |
}); | |
for (let asset of rel.data.assets) { | |
if (asset.name.endsWith('-mac.zip')) { | |
return asset.browser_download_url; | |
} | |
} | |
- name: Update mac homebrew repo | |
shell: bash | |
run: | | |
URL="${{ steps.fetch-mac-release.outputs.result }}" | |
GEODE_HASH=$(curl -L $URL | sha256sum | awk '{print $1}') | |
cd homebrew-geode/Formula | |
cp geode-cli.rb.in geode-cli.rb | |
sed -i -e "s|DOWNLOAD_URL|$URL|g" geode-cli.rb | |
sed -i -e "s/HASH/$GEODE_HASH/g" geode-cli.rb | |
- name: Push to repo | |
shell: bash | |
working-directory: ${{ github.workspace }}/homebrew-geode | |
run: | | |
git config --local user.email "${{ secrets.GEODE_BOT_EMAIL }}" | |
git config --local user.name "GeodeBot" | |
git add . | |
git commit -m "Update CLI" | |
git remote set-url origin "https://GeodeBot:${{ secrets.GEODE_BOT_PUSH_BIN_TOKEN }}@github.com/geode-sdk/homebrew-geode.git" | |
git push || true |