Skip to content

fix: stable running of mise hooks by checking for task existance #9

fix: stable running of mise hooks by checking for task existance

fix: stable running of mise hooks by checking for task existance #9

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
install: true
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test
- name: Build release asset
run: mise run release:build
env:
VERSION: ${{ github.ref_name }}
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: dist/*
- name: Update Homebrew tap
env:
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
VERSION: ${{ github.ref_name }}
run: |
set -euo pipefail
VERSION_NUM="${VERSION#v}"
ASSET="git-work_${VERSION_NUM}.tar.gz"
SHA256=$(cat "dist/${ASSET}.sha256")
URL="https://github.com/beeemT/git-work/releases/download/${VERSION}/${ASSET}"
cat > /tmp/git-work.rb <<FORMULA
class GitWork < Formula
desc "Branch-per-directory workflow wrapping git worktree"
homepage "https://github.com/beeemT/git-work"
url "${URL}"
sha256 "${SHA256}"
license "MIT"
depends_on "erlang"
def install
bin.install "git-work"
end
test do
assert_match "usage: git-work", shell_output("#{bin}/git-work --help 2>&1", 0)
end
end
FORMULA
git clone "https://x-access-token:${TAP_TOKEN}@github.com/beeemT/tap.git" /tmp/tap
mkdir -p /tmp/tap/Formula
cp /tmp/git-work.rb /tmp/tap/Formula/git-work.rb
cd /tmp/tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/git-work.rb
git commit -m "git-work ${VERSION}"
git push