Use ubuntu for release #5
Workflow file for this run
This file contains hidden or 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
name: 🚀 CI | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
name: 🚀 Release Switcher | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📥 Checkout code | |
uses: actions/checkout@v4 | |
- name: 📝 Generate release changelog | |
id: changelog_step | |
uses: janheinrichmerker/action-github-changelog-generator@v2.3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 📦 Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: Switcher-Build | |
- name: 🎈 Create or Update GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{ steps.changelog_step.outputs.changelog }} | |
files: Switcher-${{ github.ref_name }}.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🍺 Update Homebrew Formula | |
uses: actions4git/setup-git@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🍺 Update Homebrew Formula | |
run: | | |
sha256sum build/dmg/Switcher-${{ github.ref_name }}.dmg | awk '{ print $1 }' > /tmp/checksum | |
checksum=$(cat /tmp/checksum) | |
git clone https://github.com/Bobronium/homebrew-tap.git | |
cd homebrew-tap | |
formula_file="Formula/switcher.rb" | |
sed -i '' "s|url \".*\"|url \"https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/Switcher-${{ github.ref_name }}.dmg\"|" $formula_file | |
sed -i '' "s|sha256 \".*\"|sha256 \"$checksum\"|" $formula_file | |
git add Formula/switcher.rb | |
git commit -m "Bump version to ${{ github.ref_name }}" | |
git push |