-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (109 loc) · 4.22 KB
/
artifacts.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
name: Build Artifacts
on:
push:
branches: [ master ]
pull_request:
release:
types:
- published
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
fail-fast: false
matrix:
static_runtime: ["ON", "OFF"]
arch: ["x86", "x64"]
build_type: ["Release", "Debug"]
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Get Current Version
shell: bash
run: |
export VERSION=`cat VERSION.txt | tr -dc '[:print:]'`
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version is: $VERSION"
- name: Remove additional xerces build steps
shell: bash
run: |
echo "" > xerces-c/doc/CMakeLists.txt
echo "" > xerces-c/tests/CMakeLists.txt
echo "" > xerces-c/samples/CMakeLists.txt
- name: Configure CMake
shell: cmd
working-directory: ${{runner.workspace}}/build
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\instdir -DWITH_LIBXML=ON -DWITH_XERCES=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DEXPAT_MSVC_STATIC_CRT=${{matrix.static_runtime}} -DWITH_STATIC_RUNTIME=${{matrix.static_runtime}} %GITHUB_WORKSPACE%
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config ${{matrix.build_type}}
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --install . --config ${{matrix.build_type}}
rm -f ${{runner.workspace}}/libSBML-dependencies/instdir/bin/*
- name: Upload
if: matrix.static_runtime == 'ON'
uses: actions/upload-artifact@v2
with:
path: instdir/*
name: libSBML-dependencies-${{ env.VERSION }}-${{ matrix.arch }}-${{ matrix.build_type }}-static
- name: Upload
if: matrix.static_runtime == 'OFF'
uses: actions/upload-artifact@v2
with:
path: instdir/*
name: libSBML-dependencies-${{ env.VERSION }}-${{ matrix.arch }}-${{ matrix.build_type }}
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Current Version
shell: bash
run: |
export VERSION=`cat VERSION.txt | tr -dc '[:print:]'`
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Zip all artifacts again
shell: bash
run: |
for d in ./libSBML-dependencies-*/ ; do zip -qr "${d::-1}.zip" "$d"; done
ls *.zip
- name: Upload binaries to tagged release
if: github.repository == 'sbmlteam/libSBML-dependencies' && github.event_name == 'release' && github.event.action == 'published'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: libSBML-dependencies-*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Update Latest Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
name: 'Latest LibSBML dependencies'
prerelease: true
body: 'Latest build of the libSBML Dependencies'
files: |
./*.zip