-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (111 loc) · 3.5 KB
/
Copy pathrelease.yml
File metadata and controls
126 lines (111 loc) · 3.5 KB
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
name: Release
on:
release:
types: created
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- name: install C++17 compiler for Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo apt update
sudo apt install -y g++-9
- name: make build dir
run: mkdir build
- name: configure on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
cd build
cmake -DCMAKE_CXX_COMPILER=g++-9 ..
- name: configure on Mac
if: matrix.os != 'windows-latest'
run: |
cd build
cmake ..
- name: configure on Windows
if: matrix.os == 'windows-latest'
run: |
cd build
cmake -G "Visual Studio 16 2019" -A x64 -config Release ..
- name: build on ${{ matrix.os }}
run: |
cmake --build build --parallel
ls build/bin
- name: create COPYING
run: |
touch COPYING
echo "Eigen (C++ template library for linear algebra)" >> COPYING
echo "-----------------------------------------------" >> COPYING
cat build/deps/build/eigen/src/eigen/COPYING.MPL2 >> COPYING
echo "" >> COPYING
echo "toml11 (C++11 header-only toml parser/encoder)"
echo "-----------------------------------------------" >> COPYING
cat build/deps/build/toml11/src/toml11/LICENSE >> COPYING
- name: make release directory
env:
OS: ${{ runner.os }}
run: |
mkdir trochia
cp README.md trochia/
cp LICENSE trochia/
cp COPYING trochia/
cp build/bin/trochia* trochia/
- name: make archive file
if: matrix.os != 'windows-latest'
env:
OS: ${{ runner.os }}
run: zip -r trochia-$OS.zip trochia/
- name: make archive file for Windows
if: matrix.os == 'windows-latest'
run: |
cp build/bin/Debug/trochia.exe trochia
7z a trochia-Windows.zip trochia
- name: Upload archive as artifact
uses: actions/upload-artifact@v7
with:
name: "trochia-${{ runner.os }}"
path: "trochia-${{ runner.os }}.zip"
upload:
name: Upload archive file to GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: trochia-Linux
path: trochia-Linux
- name: move archive
run: mv trochia-Linux/trochia-Linux.zip trochia-linux.zip
- uses: JasonEtco/upload-to-release@master
with:
args: "trochia-linux.zip application/zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v8
with:
name: trochia-macOS
path: trochia-macOS
- name: move archive
run: mv trochia-macOS/trochia-macOS.zip trochia-mac.zip
- uses: JasonEtco/upload-to-release@master
with:
args: "trochia-mac.zip application/zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v8
with:
name: trochia-Windows
path: trochia-Windows
- name: move archive
run: mv trochia-Windows/trochia-Windows.zip trochia-windows.zip
- uses: JasonEtco/upload-to-release@master
with:
args: "trochia-windows.zip application/zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}