Repository navigation
96 lines (86 loc) · 2.76 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (86 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
# This workflow is managed by gh actions-lock.
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
name: "⚙ Auto: Release"
on:
push:
tags:
- 'v*'
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build libhaec
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ghcr.io/stefan-hoeck/idris2-pack@sha256:de9781906050dc44704ec6de0108c86f899ef17b2642932b79e00245d613b8ad
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2.2.1
with:
version: 0.15.2
- name: Typecheck and build release libraries
shell: bash
run: |
set -euo pipefail
# Same fix as ci.yml: never assert through a pipe under pipefail.
ver="$(idris2 --version)"
echo "idris2 --version -> ${ver}"
case "$ver" in
*"0.8.0"*) ;;
*) echo "::error::expected Idris 2 0.8.0, got: ${ver}"; exit 1 ;;
esac
idris2 --typecheck abi.ipkg
(
cd src/interface/ffi
zig build -Doptimize=ReleaseSafe --summary all
zig build test -Doptimize=ReleaseSafe --summary all
)
- name: Package libraries and checksums
shell: bash
env:
RELEASE_TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
archive="haec-${RELEASE_TAG}-linux-x86_64.tar.gz"
tar -C src/interface/ffi/zig-out/lib -czf "$archive" libhaec.a libhaec.so
sha256sum "$archive" > "${archive}.sha256"
- name: Upload release artifacts
uses: actions/upload-artifact@v7.0.2
with:
name: haec-release
path: |
haec-*.tar.gz
haec-*.tar.gz.sha256
if-no-files-found: error
retention-days: 7
release:
name: Publish GitHub release
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Download verified build artifacts
uses: actions/download-artifact@v8.0.2
with:
name: haec-release
path: artifacts
- name: Publish release
uses: softprops/action-gh-release@v3.0.3
with:
draft: false
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
generate_release_notes: true
files: |
artifacts/haec-*.tar.gz
artifacts/haec-*.tar.gz.sha256