Skip to content

Commit 334595d

Browse files
nsheapsclaude
andauthored
Upload platform-specific release assets for mise compatibility (#4)
* feat: upload platform-specific release assets for mise/ubi support Upload op-exec as platform-named release assets (linux-amd64, linux-arm64, darwin-amd64, darwin-arm64) so that mise can install it via the ubi backend with `mise install ubi:nsheaps/op-exec`. https://claude.ai/code/session_011NHxCTVZ4h6NKu9J1mKep7 * fix: resolve shellcheck SC2015 warning in debug function Replace `A && B || C` pattern with proper if-then-else to avoid the case where C runs when B fails (even if A is true). https://claude.ai/code/session_011NHxCTVZ4h6NKu9J1mKep7 * fix: add mise setup to check workflow for shellcheck and shfmt The check workflow assumed shellcheck and shfmt were pre-installed on ubuntu-latest. Add them as mise-managed tools and add a mise setup step so they are reliably available. https://claude.ai/code/session_011NHxCTVZ4h6NKu9J1mKep7 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 59c855f commit 334595d

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

.github/workflows/check.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@v4
1616

17+
- name: Setup mise
18+
uses: jdx/mise-action@v2
19+
1720
- name: Find bash scripts
1821
id: find-bash
1922
run: |

.github/workflows/release.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ jobs:
4646
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
4747
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
4848
49+
- name: Upload release assets
50+
env:
51+
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}
52+
run: |
53+
TAG="${{ steps.release.outputs.tag }}"
54+
# op-exec is a platform-independent bash script, but ubi (used by
55+
# mise) expects assets named with OS/arch patterns. Upload copies
56+
# for each supported platform so `mise install ubi:nsheaps/op-exec`
57+
# works out of the box.
58+
for platform in linux-amd64 linux-arm64 darwin-amd64 darwin-arm64; do
59+
cp bin/op-exec "op-exec-${platform}"
60+
done
61+
gh release upload "$TAG" op-exec-linux-amd64 op-exec-linux-arm64 op-exec-darwin-amd64 op-exec-darwin-arm64
62+
rm -f op-exec-linux-amd64 op-exec-linux-arm64 op-exec-darwin-amd64 op-exec-darwin-arm64
63+
4964
update-homebrew:
5065
needs: release
5166
runs-on: ubuntu-latest

bin/op-exec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ DEBUG=${DEBUG:-}
3535
# Helpers
3636
# -----------------------------------------------------------------------------
3737
debug() {
38-
[[ -n "$DEBUG" ]] && echo "[DEBUG] $*" >&2 || true
38+
if [[ -n "$DEBUG" ]]; then
39+
echo "[DEBUG] $*" >&2
40+
fi
3941
}
4042

4143
error() {

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[tools]
22
node = "lts"
33
yarn = "4"
4+
shellcheck = "latest"
5+
shfmt = "latest"
46

57
[tasks.lint]
68
description = "Run ShellCheck on all bash scripts"

0 commit comments

Comments
 (0)