-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (79 loc) · 2.85 KB
/
ubuntu-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
81
82
83
84
85
86
87
88
89
90
91
92
name: Windows-Ubuntu
on:
push:
branches:
- main
- feature/*
- antares_integration
- fix/*
release:
types: [ created ]
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
build_sirius:
name: ${{ matrix.os }} build sirius
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-20.04]
steps:
- name: is release created
shell: bash
run: |
release_created=${{ github.event_name == 'release' && github.event.action == 'created' }}
echo "RELEASE_CREATED=$release_created" >> $GITHUB_ENV
- name: Get release
if: ${{ env.RELEASE_CREATED == 'true' }}
id: get_release
uses:
bruceadams/[email protected]
- name: install zip for windows
if: ${{ startsWith(matrix.os, 'windows') }}
shell: cmd
run: |
choco install zip --no-progress
- name: Checkout
uses: actions/checkout@v2
- name: set sirius output variables
id: sirius-variables
shell: bash
run: |
SIRIUS_BASE_PATH="${{ github.workspace }}"
SIRIUS_INSTALL_DIR="${{ matrix.os }}_sirius-solver-install"
SIRIUS_INSTALL_PATH="${SIRIUS_BASE_PATH}/${SIRIUS_INSTALL_DIR}"
ARCHIVE_NAME="${{ matrix.os }}_sirius-solver.zip"
ARCHIVE_PATH="${SIRIUS_BASE_PATH}/${ARCHIVE_NAME}"
echo "::set-output name=install-dir::$SIRIUS_INSTALL_DIR"
echo "::set-output name=install-path::$SIRIUS_INSTALL_PATH"
echo "::set-output name=archive-name::$ARCHIVE_NAME"
echo "::set-output name=archive-path::$ARCHIVE_PATH"
- name: Configure Sirius
shell: bash
run: |
cmake -S src \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${{ steps.sirius-variables.outputs.install-dir }}"
- name: Build & Install Sirius
shell: bash
run: |
cmake --build build --config Release --target install -j14
- name: Zip Install Sirius
shell: bash
run: |
zip -r "${{ steps.sirius-variables.outputs.archive-name }}" "${{ steps.sirius-variables.outputs.install-dir }}"
- name: Upload sirius install
uses: actions/upload-artifact@v2
with:
name: ${{ steps.sirius-variables.outputs.install-dir }}
path: ${{ steps.sirius-variables.outputs.install-path }}
- name: Publish sirius install
if: ${{ env.RELEASE_CREATED == 'true' }}
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.sirius-variables.outputs.archive-path }}
asset_name: ${{ steps.sirius-variables.outputs.archive-name }}
asset_content_type: application/zip