-
Notifications
You must be signed in to change notification settings - Fork 109
136 lines (116 loc) · 4.29 KB
/
deploy.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
name: Deploy
on:
push:
branches: 'master'
paths-ignore: 'docs/**'
env:
RUST_BACKTRACE: 1
PRUSTI_ASSERT_TIMEOUT: 60000
jobs:
# Build and test in release mode
build:
strategy:
matrix:
# macos-13 is x86, macos-14 is arm64
os: [ubuntu-20.04, windows-latest, macos-13, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '15'
distribution: 'zulu'
- name: Set up the environment
run: python x.py setup
- name: Build with cargo --release
run: python x.py build --release --all --jobs 1
- name: Run cargo tests --release
run: python x.py test --release --all --jobs 1
- name: Package Prusti artifact
run: python x.py package release prusti_artifact
- name: Test Prusti artifact
run: python x.py test-package prusti_artifact
- name: Zip Prusti artifact
uses: thedoctor0/[email protected]
with:
directory: prusti_artifact
filename: release.zip
- name: Upload Prusti artifact
uses: actions/upload-artifact@v3
with:
name: prusti-release-${{ matrix.os }}
if-no-files-found: error
path: prusti_artifact/release.zip
# Deploy to a new GitHub pre-release
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all Prusti artifacts
uses: actions/download-artifact@v2
- name: Create release tag
shell: bash
run: echo "TAG_NAME=$(date +v-%Y-%m-%d-%H%M)" >> $GITHUB_ENV
- name: Create a nightly release
id: create_release
uses: viperproject/create-nightly-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Nightly Release ${{ env.TAG_NAME }}
keep_num: 4
- name: Upload release asset for Ubuntu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./prusti-release-ubuntu-20.04/release.zip
asset_name: prusti-release-ubuntu.zip
asset_content_type: application/zip
- name: Upload release asset for Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./prusti-release-windows-latest/release.zip
asset_name: prusti-release-windows.zip
asset_content_type: application/zip
# This asset is only for backward compatibility with Prusti-Assistant. After updating
# Prusti-Assistant to use the new asset name, we can wait a while and then delete this.
- name: Upload release asset for macOS x86 using a backward-compatibile name
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./prusti-release-macos-13/release.zip
asset_name: prusti-release-macos.zip
asset_content_type: application/zip
- name: Upload release asset for macOS x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./prusti-release-macos-13/release.zip
asset_name: prusti-release-macos-x86.zip
asset_content_type: application/zip
- name: Upload release asset for macOS arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./prusti-release-macos-14/release.zip
asset_name: prusti-release-macos-arm64.zip
asset_content_type: application/zip