forked from verus-lang/verus
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (102 loc) · 3.13 KB
/
Copy pathbuild.yml
File metadata and controls
117 lines (102 loc) · 3.13 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: build
on:
workflow_call:
inputs:
checkout_ref:
description: Git ref or SHA to build
required: true
type: string
is_rolling:
description: Whether this is a Rolling Release build
required: true
type: boolean
outputs:
version:
description: Version derived from the built Linux artifact
value: ${{ jobs.metadata.outputs.version }}
permissions:
contents: read
jobs:
build:
if: github.repository == 'verus-lang/verus'
strategy:
matrix:
build: [macos, macos-x86_64, linux, windows]
include:
- build: macos
os: macos-14
release_name: verus-arm64-macos
- build: macos-x86_64
os: macos-15-intel
release_name: verus-x86-macos
- build: linux
os: ubuntu-24.04
release_name: verus-x86-linux
- build: windows
os: windows-2022
release_name: verus-x86-win
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout_ref }}
- name: get z3
working-directory: ./source
run: |
./tools/get-z3.sh
echo "z3 version $(./z3 --version)"
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.97.1
- name: create temporary toolchain manifest for a rolling release
if: inputs.is_rolling
working-directory: ./source
run: |
cargo run -p cargo-verus-toolchains --bin create-manifest -- --rolling --write-to-dir cargo-verus/toolchain-manifests
- name: build
working-directory: ./source
run: |
. ../tools/activate
vargo clean
vargo build --release
- name: create archive
working-directory: ./source
run: |
./target-verus/release/verus --version --output-json > ./target-verus/release/version.json
cp -R ./target-verus/release "../${{ matrix.release_name }}"
cd ..
if [ "${{ matrix.os }}" == "windows-2022" ]; then
7z a "${{ matrix.release_name }}.zip" "./${{ matrix.release_name }}"
else
zip -r "${{ matrix.release_name }}.zip" "./${{ matrix.release_name }}"
fi
- name: upload release artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.release_name }}
path: ${{ matrix.release_name }}.zip
metadata:
needs: [build]
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.read_version.outputs.version }}
steps:
- name: download linux artifact
uses: actions/download-artifact@v8
with:
name: verus-x86-linux
path: verus-x86-linux
- name: read version
id: read_version
shell: bash
run: |
cd verus-x86-linux
unzip verus-x86-linux.zip
version="$(cat ./verus-x86-linux/version.txt)"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "${version}"