-
Notifications
You must be signed in to change notification settings - Fork 16
177 lines (158 loc) · 6.3 KB
/
nightly-build.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: nightly
on:
push:
branches: [main, ci]
jobs:
move-tag:
runs-on: ubuntu-latest
steps:
- name: Move ci tag
run: |
mkdir repo
git clone -b "$BRANCH_NAME" "https://github.com/${GITHUB_REPOSITORY}" repo
cd repo
bash .github/workflows/move-tag.sh "nightly-build" "Last commit build by the CI"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
check-aya-version:
runs-on: ubuntu-latest
outputs:
isSnapshot: ${{ steps.check.outputs.isSnapshot }}
steps:
- uses: actions/checkout@v3
- name: Check snapshot version
id: check
run: |
ver="$(cat ./gradle/deps.properties | grep "version.project" | cut -d'=' -f2)"
isSnapshot="$(echo "$ver" | grep -q "SNAPSHOT" && echo true || echo false)"
echo "Detected Project Version: $ver"
echo "Detected Project Version is a SNAPSHOT: $isSnapshot"
echo "::set-output name=isSnapshot::${isSnapshot}"
publish-snapshot:
needs: [check-aya-version]
runs-on: ubuntu-latest
if: github.repository == 'aya-prover/aya-dev' && needs.check-aya-version.outputs.isSnapshot == 'true'
env:
ossrhUsername: ${{ secrets.OSSRHUSERNAME }}
ossrhPassword: ${{ secrets.OSSRHPASSWORD }}
steps:
- uses: actions/checkout@v3
- name: Setup Java 20
uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '20'
- name: gradle publish
uses: gradle/gradle-build-action@v2
with:
arguments: publish --info --no-daemon --stacktrace --warning-mode all
nightly-build:
needs: [move-tag]
runs-on: ${{ matrix.os }}
env:
nativeName: aya-prover_native_${{ matrix.platform }}${{ matrix.binaryExt }}
nativeSha256: aya-prover_native_${{ matrix.platform }}${{ matrix.binaryExt }}.sha256.txt
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: 'linux-x64'
binaryExt: ''
- os: macos-latest
platform: 'macos-x64'
binaryExt: ''
- os: windows-latest
platform: 'windows-x64'
binaryExt: '.exe'
steps:
- uses: actions/checkout@v3
- name: Setup Java 20
uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '20'
- name: Run task jlinkAyaZip
uses: gradle/gradle-build-action@v2
with:
arguments: jlinkAyaZip --info --no-daemon --stacktrace --warning-mode all
if: matrix.os == 'ubuntu-latest'
- name: Run task fatJar
uses: gradle/gradle-build-action@v2
with:
arguments: fatJar --no-daemon --stacktrace --warning-mode all
if: matrix.os == 'ubuntu-latest'
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '20'
distribution: 'graalvm-community'
components: 'native-image'
set-java-home: 'false'
github-token: ${{ secrets.GH_TOKEN }}
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Tell gradle where's my JDK
run: |
# Gradle should respect these environmental variables by default!
echo 'org.gradle.java.installations.fromEnv=JAVA_HOME,GRAALVM_HOME' >> gradle.properties
- name: Gradle, do you understand?
uses: gradle/gradle-build-action@v2
with:
arguments: javaToolchains --no-daemon --stacktrace --warning-mode all
- name: Run task nativeCompile
uses: gradle/gradle-build-action@v2
with:
arguments: nativeCompile --no-daemon --stacktrace --warning-mode all
- name: Copy aya Native Image
run: cp ./cli-console/build/native/nativeCompile/aya${{ matrix.binaryExt }} ./${{ env.nativeName }}
- name: Checksum (Native, Unix)
run: shasum -a 256 ./${{ env.nativeName }} > ./${{ env.nativeSha256 }}
if: matrix.os != 'windows-latest'
- name: Checksum (Native, Windows)
run: Get-FileHash ./${{ env.nativeName }} -Algorithm SHA256 > ./${{ env.nativeSha256 }}
if: matrix.os == 'windows-latest'
- name: Test native image
run: ./${{ env.nativeName }} --remake base/src/test/resources/success
- name: Update Release (Native images)
uses: Xotl/cool-github-releases@v1
if: matrix.os != 'ubuntu-latest'
with:
mode: update
isPrerelease: false
tag_name: nightly-build
release_name: "Nightly builds"
body_mrkdwn: |
_These are latest builds, but the date on GitHub is frozen due to stupid limitations.
Corresponding commit: <https://github.com/aya-prover/aya-dev/commit/${{ github.sha }}>_
assets: ${{ env.nativeSha256 }};${{ env.nativeName }}|application/octet-stream
replace_assets: true
github_token: ${{ secrets.GH_TOKEN }}
- name: Collect jlink zip files
if: matrix.os == 'ubuntu-latest'
id: collect_jlinkAyaZip
run: |
jlinkFiles="$(find ide-lsp/build/image -maxdepth 1 -type f -exec echo -n '{};' \;)"
echo "Found jlinkAyaZip outputs: $jlinkFiles"
echo "::set-output name=jlinkFiles::$jlinkFiles"
- name: Copy fat jar
if: matrix.os == 'ubuntu-latest'
run: |
cp ./ide-lsp/build/libs/*-fat.jar ./lsp-fatjar.jar
cp ./cli-console/build/libs/*-fat.jar ./cli-fatjar.jar
- name: Update Release (jlink zips and jars)
uses: Xotl/cool-github-releases@v1
if: matrix.os == 'ubuntu-latest'
with:
mode: update
isPrerelease: false
tag_name: nightly-build
release_name: "Nightly builds"
body_mrkdwn: |
_These are latest builds, but the date on GitHub is frozen due to stupid limitations.
Corresponding commit: <https://github.com/aya-prover/aya-dev/commit/${{ github.sha }}>_
assets: ${{ env.nativeSha256 }};${{ env.nativeName }}|application/octet-stream;lsp-fatjar.jar;cli-fatjar.jar;${{ steps.collect_jlinkAyaZip.outputs.jlinkFiles }}
replace_assets: true
github_token: ${{ secrets.GH_TOKEN }}