-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.27 KB
/
windows.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
name: Windows
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-2022
env:
VCVARS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Python cache
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-refreshed-at-20200621-1
restore-keys: |
${{ runner.os }}-pip-
- name: Download python dependencies
run: |
python -m pip install setuptools wheel
python -m pip install conan ninja
- name: Conan cache
uses: actions/cache@v2
with:
path: ~/.conan
key: ${{ runner.os }}-conan-refreshed-at-20200716
restore-keys: |
${{ runner.os }}-conan-
- name: Configure
shell: cmd
run: |
call "%VCVARS%"
cmake -S. -Bbuild -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DENABLE_PACKAGING=ON -DCMAKE_BUILD_TYPE=Release -DCPACK_PACKAGE_FILE_NAME=Frontend.swift-Windows-Release -G Ninja
- name: Build
shell: cmd
run: |
call "%VCVARS%"
cmake --build build -j4
- name: Build the release tar.xz package
if: github.ref == 'refs/heads/main'
shell: cmd
run: |
call "%VCVARS%"
cpack -G TXZ --config build/CPackConfig.cmake
- name: Push release
if: github.ref == 'refs/heads/main'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
echo "Pushing to the latest tag"
gh release create latest --title "Latest release from main" --notes "This release gets updated with each commit to main" || true
gh release upload latest Frontend.swift-Windows-Release.tar.xz --clobber
version="$(cat docs/ReleaseNotes/version)"
echo "Making sure the release ${version} is online"
test -f docs/ReleaseNotes/${version}.md
gh release create "${version}" --title "${version}" --notes-file "docs/ReleaseNotes/${version}.md" || true
gh release upload "${version}" Frontend.swift-Windows-Release.tar.xz || true