-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (155 loc) · 5.87 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
name: Publish RDA
on:
workflow_dispatch:
# pull_request:
push:
branches:
- main
- nadeem*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
name: 'Publish RDA'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04 # This is CentOS 7 under the hood
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
MODE: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
repository: os-fpga/raptor_downloader_closed
token: ${{ secrets.RELEASEPAT }}
- name: Setup Node.js ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' }}
uses: actions/setup-node@v4
with:
node-version: 20.11 #if update this then also update in Dockerfile for centos
- name: Setup Python
if: ${{ matrix.os != 'ubuntu-22.04' }}
uses: actions/[email protected]
with:
python-version: 3.8 #if update this then also update in Dockerfile for centos
- name: Shell config on ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' }}
run: |
node --version
python3 -V
ls -l
- name: Install packages ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' }}
run: |
npm install
- name: setup-headless-display-action
uses: pyvista/setup-headless-display-action@v2
- name: Do Magic on ${{ matrix.os }}
if: ${{ matrix.os == 'windows-latest' }}
run: |
python3 rename.py --src main.js --dst orgnl_main.js
python3 rename.py --src main_byte.js --dst main.js
npm start
python3 rename.py --src to_be_main.js --dst main.js
- name: Do Magic on ${{ matrix.os }}
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install coreutils
python3 rename.py --src main.js --dst orgnl_main.js
python3 rename.py --src main_byte.js --dst main.js
(timeout 10 npm start || [ $? -eq 124 ]) && exit 0 || exit $?
python3 rename.py --src to_be_main.js --dst main.js
- name: Do packaging on ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' }}
run: |
npm run dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Show dist on ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' && matrix.os == 'macos-latest' }}
run: |
ls -l dist
- name: Show dist on ${{ matrix.os }}
if: ${{ matrix.os != 'ubuntu-22.04' && matrix.os == 'windows-latest' }}
run: |
dir dist
########## Linux CentOS 7 ############################
- name: Login to the Container registry
if: ${{ matrix.os == 'ubuntu-22.04' }}
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull the CentOS image
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: docker pull ghcr.io/${{ github.repository_owner }}/raptor_downloader:centos7latest
- name: Shell configuration on centos 7
if: ${{ matrix.os == 'ubuntu-22.04' }}
uses: addnab/docker-run-action@v3
with:
shell: bash
image: ghcr.io/${{ github.repository_owner }}/raptor_downloader:centos7latest
run: |
source /opt/rh/devtoolset-11/enable
cmake --version
node --version
python3 -V
- name: Install Package on Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
uses: addnab/docker-run-action@v3
with:
shell: bash
image: ghcr.io/${{ github.repository_owner }}/raptor_downloader:centos7latest
options: -v ${{ github.workspace }}:/work
run: |
cd /work
npm install
- name: Do magic on Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
python3 rename.py --src main.js --dst orgnl_main.js
python3 rename.py --src main_byte.js --dst main.js
npm start
python3 rename.py --src to_be_main.js --dst main.js
- name: Create Package on Linux
if: ${{ matrix.os == 'ubuntu-22.04' }}
uses: addnab/docker-run-action@v3
with:
shell: bash
image: ghcr.io/${{ github.repository_owner }}/raptor_downloader:centos7latest
options: -v ${{ github.workspace }}:/work
run: |
cd /work
npm run dist
cd dist && tar -cvzf raptor_downloader_linux.tar.gz raptor_downloader_linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
########## Upload #######################
- name: Run on refs/tags only
run: |
echo ${{ github.ref }}
- name: Upload Release ${{ matrix.os }}
#if: ${{ matrix.os != 'ubuntu-22.04' && contains(github.ref, 'refs/tags/') }}
#if: ${{ matrix.os != 'ubuntu-22.04' }}
uses: softprops/action-gh-release@v1
with:
files: dist/raptor_downloader_*.tar.gz
repository: os-fpga/post_build_artifacts
token: ${{ secrets.RELEASEPAT }}
tag_name: v0.3
# - name: Upload Release ${{ matrix.os }}
# #if: ${{ matrix.os == 'ubuntu-22.04' && contains(github.ref, 'refs/tags/') }}
# if: ${{ matrix.os == 'ubuntu-22.04' }}
# uses: softprops/action-gh-release@v1
# with:
# files: dist/raptor_downloader_linux
# repository: os-fpga/post_build_artifacts
# token: ${{ secrets.RELEASEPAT }}
# tag_name: v0.3