Skip to content

Commit 6b7810e

Browse files
committed
Add a GitHub Action to generate the released archives
1 parent da20da9 commit 6b7810e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/release.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Generate assets on releases
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
assets:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: true
16+
17+
- name: Generate archives
18+
env:
19+
GH_TOKEN: ${{ github.token }}
20+
run: |
21+
tag="${GITHUB_REF#refs/tags/}"
22+
git archive --prefix="ocaml-$tag/" @ >ocaml.tar
23+
git -C winpthreads archive --prefix="ocaml-$tag/winpthreads/" @ >w.tar
24+
cp ocaml.tar ocaml-winpthreads.tar
25+
tar -A -f ocaml-winpthreads.tar w.tar
26+
xz ocaml.tar
27+
osha="$(sha256sum ocaml.tar.xz | awk '{print $1}')"
28+
xz ocaml-winpthreads.tar
29+
owsha="$(sha256sum ocaml-winpthreads.tar.xz | awk '{print $1}')"
30+
gh release upload "$tag" "ocaml.tar.xz#ocaml.tar.xz ($osha)"
31+
gh release upload "$tag" "ocaml-winpthreads.tar.xz#ocaml-winpthreads.tar.xz ($owsha)"

0 commit comments

Comments
 (0)