forked from highperformancecoder/scidavis-old
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 3.07 KB
/
packaging.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
name: Packaging
on:
push:
tags:
- "*"
jobs:
Release:
name: Release
runs-on: windows-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ./NEWS.md
draft: false
prerelease: false
MSVC:
name: MSVC
runs-on: windows-latest
needs: Release
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- uses: lukka/run-vcpkg@v6
with:
vcpkgGitCommitId: 50ea8c0ab7aca3bb9245bba7fc877ad2f2a4464c
setupOnly: true
- name: Install VCPKG packages
run: |
Add-Content ${{ env.VCPKG_ROOT }}\triplets\x64-windows.cmake "set(VCPKG_BUILD_TYPE release)"
${{ env.VCPKG_ROOT }}\vcpkg install zlib gsl muparser opengl gl2ps gtest --triplet x64-windows
- name: Configuring
run: |
mkdir build; cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}\scripts\buildsystems\vcpkg.cmake `
-DORIGIN_IMPORT=ON -DRUNTIME_DIR=${{ env.VCPKG_ROOT }}/installed/x64-windows/bin `
-DCPACK_PACKAGE_FILE_NAME=scidavis
- name: Building
run: |
cmake --build build --config Release -- -maxCpuCount
- name: Testing
run: |
cd build
ctest -C Release --output-on-failure
- name: Packaging
id: packaging
continue-on-error: true
run: |
$Env:version = (git describe --tags)
$Env:version
echo "::set-output name=version::$Env:version"
cd build
cpack -G WIX
cpack -G NSIS
- name: Upload MSI installer
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Release.outputs.upload_url }}
asset_path: build/scidavis.msi
asset_name: scidavis-${{ steps.packaging.outputs.version }}-win64.msi
asset_content_type: application/zip
- name: Upload NSIS installer
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.Release.outputs.upload_url }}
asset_path: build/scidavis.exe
asset_name: scidavis-${{ steps.packaging.outputs.version }}-win64.exe
asset_content_type: application/zip