-
Notifications
You must be signed in to change notification settings - Fork 19
166 lines (147 loc) · 6.15 KB
/
nightly-build.yaml
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
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:
uses: aya-prover/aya-dev/.github/workflows/extract-version.yaml@main
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 ${{ needs.check-aya-version.outputs.javaVersion }}
uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: ${{ needs.check-aya-version.outputs.javaVersion }}
- name: gradle publish
uses: gradle/gradle-build-action@v2
with:
arguments: publish --info --no-daemon --stacktrace --warning-mode all
nightly-build:
needs: [move-tag, check-aya-version]
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 ${{ needs.check-aya-version.outputs.javaVersion }}
uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: ${{ needs.check-aya-version.outputs.javaVersion }}
- 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 for Java ${{ needs.check-aya-version.outputs.javaVersion }}
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ needs.check-aya-version.outputs.javaVersion }}
distribution: 'graalvm-community'
components: 'native-image'
set-java-home: 'true'
cache: 'gradle'
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 }}