Skip to content

Commit 5fb24a4

Browse files
authored
fix(ci): package release binaries with the wrapper scripts (#24)
A bare binary download had no lcreate/lcls/lclose/lcomment/lproj - only install.sh and the container image ever pulled those, from a repo checkout, never a release asset. Package each target into a per-platform tarball with the wrapper scripts instead. Closes #23.
1 parent c629cc3 commit 5fb24a4

2 files changed

Lines changed: 40 additions & 7 deletions

File tree

.github/workflows/burrito-release.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,43 @@ jobs:
7676
fi
7777
done
7878
[ "$missing" -eq 0 ]
79+
-
80+
# A bare `lc_macos_aarch64` binary download doesn't get you
81+
# lcreate/lcls/lclose/lcomment/lproj - only install.sh and the
82+
# container image ever pulled those, straight from the repo
83+
# checkout, never from a release asset. Package each target
84+
# together with the wrapper scripts so a release download is
85+
# actually installable on its own, matching what install.sh gives
86+
# you.
87+
name: Package each target into a per-platform tarball with the wrapper scripts
88+
run: |
89+
for artifact in lc_*
90+
do
91+
case "$artifact" in
92+
lc_windows_x86_64.exe)
93+
target=lc_windows_x86_64
94+
binary_name=lc.exe
95+
;;
96+
*)
97+
target=$artifact
98+
binary_name=lc
99+
;;
100+
esac
101+
102+
stage=$(mktemp -d)
103+
cp "$artifact" "$stage/$binary_name"
104+
cp ../../bin/lcreate ../../bin/lcls ../../bin/lclose ../../bin/lcomment ../../bin/lproj "$stage/"
105+
chmod +x "$stage"/*
106+
tar -czf "${target}.tar.gz" -C "$stage" .
107+
rm -rf "$stage" "$artifact"
108+
done
109+
working-directory: app/burrito_out
79110
-
80111
name: Generate checksums for every built artifact
81112
run: sha256sum * > SHA256SUMS
82113
working-directory: app/burrito_out
83114
-
84-
name: Upload binaries and checksums to the GitHub release
115+
name: Upload release tarballs and checksums to the GitHub release
85116
env:
86117
GH_TOKEN: ${{ github.token }}
87118
run: gh release upload "${{ inputs.tag_name }}" app/burrito_out/* --clobber

Readme.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,20 @@ to an empty value (as above) for one-off interactive CLI usage - otherwise
3737

3838
=== Download a release binary (Most should use this)
3939

40-
Grab the binary for your platform from the
40+
Grab the tarball for your platform from the
4141
https://github.com/rubyists/linear-cli-ex/releases[latest release] - macOS
4242
(Apple Silicon), Linux (x86_64), and Windows (x86_64) are all built as
43-
standalone executables with no Erlang/Elixir install required.
43+
standalone executables with no Erlang/Elixir install required. Each tarball
44+
bundles `lc` with the wrapper scripts (`lcreate`, `lcls`, `lclose`,
45+
`lcomment`, `lproj`).
4446

4547
[source,sh]
4648
----
47-
$ curl -sLO https://github.com/rubyists/linear-cli-ex/releases/latest/download/lc_macos_aarch64
49+
$ curl -sLO https://github.com/rubyists/linear-cli-ex/releases/latest/download/lc_macos_aarch64.tar.gz
4850
$ curl -sLo SHA256SUMS https://github.com/rubyists/linear-cli-ex/releases/latest/download/SHA256SUMS
49-
$ grep -q lc_macos_aarch64 SHA256SUMS && grep lc_macos_aarch64 SHA256SUMS | shasum -a 256 -c - <1>
50-
$ chmod +x lc_macos_aarch64
51-
$ sudo mv lc_macos_aarch64 /usr/local/bin/lc
51+
$ grep -q lc_macos_aarch64.tar.gz SHA256SUMS && grep lc_macos_aarch64.tar.gz SHA256SUMS | shasum -a 256 -c - <1>
52+
$ mkdir lc && tar -xzf lc_macos_aarch64.tar.gz -C lc
53+
$ sudo mv lc/* /usr/local/bin/
5254
----
5355
<1> Linux: `sha256sum -c -` instead of `shasum -a 256 -c -`.
5456

0 commit comments

Comments
 (0)