Skip to content

Commit 1ed8410

Browse files
committed
Try to fix CI release mechanism (again)
1 parent ba9f012 commit 1ed8410

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

.github/workflows/pure.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,29 @@ on:
1414
- master
1515
workflow_dispatch:
1616

17-
env:
18-
HOLDIR: ${{ github.workspace }}/HOL
19-
CAKEMLDIR: ${{ github.workspace }}/cakeml
20-
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
21-
2217
jobs:
2318

2419
build:
2520
runs-on: self-hosted
2621
container: ubuntu:20.04
2722

23+
env:
24+
HOLDIR: ${{ github.workspace }}/HOL
25+
CAKEMLDIR: ${{ github.workspace }}/cakeml
26+
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
27+
28+
outputs:
29+
hol_sha: ${{ steps.shas.outputs.HOL_SHA }}
30+
cakeml_sha: ${{ steps.shas.outputs.CAKEML_SHA }}
31+
2832
steps:
2933
- name: Update PATH
3034
run: |
3135
echo "$HOLDIR/bin" >> $GITHUB_PATH
3236
- name: Get build-essentials
3337
run: |
3438
apt update
35-
apt install -y build-essential gcc-10 libffi-dev wget mlton
39+
apt install -y git build-essential gcc-10 libffi-dev wget mlton
3640
3741
- name: Checkout Poly/ML
3842
uses: actions/checkout@v2
@@ -162,6 +166,14 @@ jobs:
162166
cd pure/examples
163167
make check
164168
169+
- name: Record HOL/CakeML checkouts
170+
id: shas
171+
run: |
172+
cd $HOLDIR
173+
echo "HOL_SHA=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
174+
cd $CAKEMLDIR
175+
echo "CAKEML_SHA=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
176+
165177
release:
166178
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master'
167179
needs: build
@@ -181,22 +193,21 @@ jobs:
181193
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
182194
apt update && apt install -y gh
183195
184-
- name: Get release tag
196+
- name: Create release tag and release notes
185197
run: |
186-
cd pure
187198
echo "VERSION=v$(date +'%Y.%m.%d')" >> $GITHUB_ENV
199+
echo "HOL checkout: HOL-Theorem-Prover/HOL@${{ needs.build.outputs.hol_sha }}" >> $COMMITS
200+
echo "CakeML checkout: CakeML/CakeML@${{ needs.build.outputs.cakeml_sha }}" >> $COMMITS
188201
189-
- name: Get HOL4/CakeML versions
190-
run: |
191-
cd $HOLDIR
192-
echo "HOL checkout: HOL-Theorem-Prover/HOL@$(git rev-parse --short HEAD)" >> $COMMITS
193-
cd $CAKEMLDIR
194-
echo "CakeML checkout: CakeML/CakeML@$(git rev-parse --short HEAD)" >> $COMMITS
202+
- name: Download build artifact
203+
uses: actions/download-artifact@v3
204+
with:
205+
name: pure.S
195206

196207
- name: Create GitHub release
197208
env:
198209
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199210
run: |
200-
cd pure
201-
gh release create ${{ env.VERSION }} --latest -F ${{ env.COMMITS }} compiler/binary/pure.S
211+
gh release create ${{ env.VERSION }} --repo cakeml/pure --latest --notes-file $COMMITS pure.S
212+
rm -f pure.S $COMMITS
202213

0 commit comments

Comments
 (0)