Skip to content

Commit adbb063

Browse files
authored
refactor: Ensure the uploaded artifacts are single .tar.gz files (#432)
* This will be very useful when using a (release-please)-based GHA. * (see https://ss64.com/osx/tar.html for the meaning of `tar -h`)
1 parent d607281 commit adbb063

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/static-builds.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
static-bin-linux:
1616
name: Builds static Linux binaries
1717
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
artifact: ["learn-ocaml-linux-x86_64.tar.gz"]
21+
# we could use an env var, albeit it would be less convenient
1822
steps:
1923
- name: Check out the repo
2024
uses: actions/checkout@v2
@@ -28,19 +32,25 @@ jobs:
2832
ldd "${bin[@]}"
2933
for b in "${bin[@]}"; do ( set -x; "$b" --version ); done
3034
- name: Archive static binaries
35+
run: |
36+
uname -a
37+
tar cvzf ${{ matrix.artifact }} \
38+
learn-ocaml learn-ocaml-server learn-ocaml-client
39+
- name: Upload static binaries
3140
uses: actions/upload-artifact@v2
3241
with:
33-
name: static-binaries-linux
34-
path: |
35-
learn-ocaml
36-
learn-ocaml-server
37-
learn-ocaml-client
42+
name: ${{ matrix.artifact }}
43+
path: ${{ matrix.artifact }}
3844
static-bin-macos:
3945
name: Builds static Macos binaries
4046
runs-on: macos-latest
4147
env:
4248
OPAMYES: 1
4349
OPAMDEPEXTYES: 1
50+
strategy:
51+
matrix:
52+
artifact: ["learn-ocaml-darwin-x86_64.tar.gz"]
53+
# we could use an env var, albeit it would be less convenient
4454
steps:
4555
- name: Check out the repo
4656
uses: actions/checkout@v2
@@ -71,7 +81,13 @@ jobs:
7181
otool -L "$dir"/*
7282
for b in "${bin[@]}"; do ( set -x; "$dir/$b" --version ); done
7383
- name: Archive static binaries
84+
run: |
85+
uname -a
86+
cd _build/install/default/bin
87+
tar cvzhf "$OLDPWD"/${{ matrix.artifact }} \
88+
learn-ocaml learn-ocaml-server learn-ocaml-client
89+
- name: Upload static binaries
7490
uses: actions/upload-artifact@v2
7591
with:
76-
name: static-binaries-macos
77-
path: _build/install/default/bin/*
92+
name: ${{ matrix.artifact }}
93+
path: ${{ matrix.artifact }}

0 commit comments

Comments
 (0)