forked from crux-toolkit/crux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (177 loc) · 7.3 KB
/
main.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: build-crux-distributions
on:
push:
branches: master
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build-macos-windows-distributions:
strategy:
matrix:
os: [macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- name: checkout-repository
uses: actions/checkout@v3
- name: add-short-sha
shell: bash
run: |
echo "git_short_sha=`git rev-parse --short HEAD`" >> $GITHUB_ENV
- name: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: configure-build-for-macos
if: matrix.os == 'macos-latest'
shell: bash
run: |
python -m pip install --upgrade pip numpy pandas
brew install cucumber-ruby
cmake -E make_directory "${{runner.workspace}}/build"
cd "${{runner.workspace}}/build"
echo Configuring in $(pwd)
cmake "${{github.workspace}}" -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: configure-build-for-windows-2019
if: matrix.os == 'windows-2019'
shell: cmd
run: |
cmake -E make_directory "${{runner.workspace}}/build"
cd "${{runner.workspace}}/build"
C:\msys64\usr\bin\wget.exe wget http://noble.gs.washington.edu/crux-downloads/Thermo.zip
unzip -P iacceptthelicense Thermo.zip -d dlls
echo "XRawfile2_x64.dll"
regsvr32 /S dlls\Thermo\MSFileReader\XRawfile2_x64.dll
echo "fregistry_x64.dll"
regsvr32 /S dlls\Thermo\MSFileReader\fregistry_x64.dll
echo "Fileio_x64.dll.dll"
regsvr32 /S dlls\Thermo\MSFileReader\Fileio_x64.dll.dll
cmake "${{github.workspace}}" -G "Visual Studio 16 2019" -A x64 -DPERCOLATOR_GIT_VERSION=e806a0c
- name: build-on-macos-and-windows
shell: bash
run: |
cd "${{runner.workspace}}/build"
echo Building in $(pwd)
cmake --build . --config $BUILD_TYPE
- name: build-package-macos-windows-packages
shell: bash
run: |
cd "${{runner.workspace}}/build"
cmake --build . --config $BUILD_TYPE --target package
- name: archive-macos-package
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: crux-4.1.${{env.git_short_sha}}.macos
path: ${{runner.workspace}}/build/crux-4.1.Darwin.x86_64.zip
- name: archive-windows-package
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v3
with:
name: crux-4.1.${{env.git_short_sha}}.windows
path: ${{runner.workspace}}/build/crux-4.1.Windows.i386.zip
build-crux-on-centos-7:
runs-on: 'ubuntu-latest'
container: 'centos:centos7'
needs: build-macos-windows-distributions
steps:
- name: Install prerequisites for Docker Centos 7
shell: bash
run: |
yum -y update
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum -y install epel-release
yum -y install git
git --version
yum -y install lbzip2
yum -y install cmake3
yum -y install centos-release-scl
yum-config-manager --enable rhel-server-rhscl-7-rpms
yum -y install devtoolset-8
yum -y install rh-python36
yum -y install rh-ruby27
yum -y install rh-ruby27-ruby-devel
yum -y install gem
scl enable devtoolset-8 rh-ruby27 'gcc --version'
scl enable rh-python36 'python --version'
scl enable rh-python36 'python -m pip install --upgrade pip numpy pandas'
scl enable rh-ruby27 'gem install cucumber rspec'
- name: Checkout
uses: actions/checkout@v3
- name: add-short-sha env property
shell: bash
run: |
git config --global --add safe.directory /__w/crux-toolkit/crux-toolkit
echo git_short_sha=$(git rev-parse --short HEAD) >> $GITHUB_ENV
echo "${{github.workspace}}"
- name: Configure and build on Centos
shell: bash
run: |
echo $(pwd)
ls doc/user/*.html
scl enable devtoolset-8 "cmake3 -DCMAKE_BUILD_TYPE=$BUILD_TYPE ."
scl enable devtoolset-8 "cmake3 --build . --config $BUILD_TYPE"
- name: Test
shell: bash
run: |
cd test/smoke-tests
scl enable rh-python36 rh-ruby27 'cucumber --publish-quiet --tags "not @ignore" -f html -o smoke-tests.html'
- name: Build binary and source packages
shell: bash
run: |
cmake3 --build . --config $BUILD_TYPE --target package
cmake3 --build . --config $BUILD_TYPE --target package_source
- name: Archive Centos 7 binary package
uses: actions/upload-artifact@v3
with:
name: crux-4.1.${{env.git_short_sha}}.centos7
path: crux-4.1.Linux.x86_64.zip
- name: Archive source package
uses: actions/upload-artifact@v3
with:
name: crux-4.1.${{env.git_short_sha}}.Source
path: crux-4.1.Source.tar.gz
- name: Archive smoke test results
uses: actions/upload-artifact@v3
with:
name: smoke.html
path: test/smoke-tests/smoke-tests.html
- name: Create version file
shell: bash
run: |
echo ${{env.git_short_sha}} > doc/user/latest-build.txt
- name: Push modified webpages to website repository
if: github.ref == 'refs/heads/master'
uses: nkoppel/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.DOC_UPDATE_KEY}}
with:
source-files: 'doc/user/*'
destination-username: 'crux-toolkit'
destination-repository: 'crux-toolkit.github.io'
destination-directory: '.'
commit-email: '[email protected]'
- name: Push command webpages to website repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.DOC_UPDATE_KEY }}
with:
source_file: 'doc/user/commands/'
destination_repo: 'crux-toolkit/crux-toolkit.github.io'
destination_branch: master
destination_folder: '.'
user_email: '[email protected]'
user_name: 'CharlesEGrant'
commit_message: 'Update version file for the web site'
- name: Copy version file to website repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.DOC_UPDATE_KEY }}
with:
source_file: 'doc/user/latest-build.txt'
destination_repo: 'crux-toolkit/crux-toolkit.github.io'
destination_branch: master
destination_folder: '.'
user_email: '[email protected]'
user_name: 'CharlesEGrant'
commit_message: 'Update version file for the web site'