-
Notifications
You must be signed in to change notification settings - Fork 33
180 lines (178 loc) · 6.27 KB
/
build-cpp.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
name: C++
on:
push:
env:
ASSETS_URL: "https://api.github.com/repos/melpon/wandbox-builder/releases/178117233/assets"
UPLOAD_URL: "https://uploads.github.com/repos/melpon/wandbox-builder/releases/178117233/assets{?name,label}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
_asset:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: |
pip3 install requests
python3 get_asset_info.py ${{ env.ASSETS_URL }} --github_token ${{ env.GITHUB_TOKEN }} > asset_info.json
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: asset_info.json
path: asset_info.json
gcc:
needs: [_asset]
strategy:
fail-fast: false
matrix:
version:
- 13.2.0
- 12.3.0
- 11.4.0
- 10.5.0
- 9.3.0
- 8.4.0
- 7.5.0
- 6.5.0
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: asset_info.json
path: asset_info.json
- id: setup
run: ./ga-build/${{ github.job }}/run.sh setup ${{ matrix.version }}
- id: install
if: steps.setup.outputs.need_install == 'true'
run: ./ga-build/${{ github.job }}/run.sh install ${{ matrix.version }}
- uses: actions/upload-release-asset@v1
if: steps.setup.outputs.need_install == 'true'
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ steps.install.outputs.package_path }}
asset_name: ${{ steps.install.outputs.package_filename }}
asset_content_type: application/gzip
clang:
needs: [_asset]
strategy:
fail-fast: false
matrix:
version:
- 17.0.1
- 16.0.4
- 15.0.7
- 14.0.6
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: asset_info.json
path: asset_info.json
- id: setup
run: ./ga-build/${{ github.job }}/run.sh setup ${{ matrix.version }}
- id: install
if: steps.setup.outputs.need_install == 'true'
run: ./ga-build/${{ github.job }}/run.sh install ${{ matrix.version }}
- uses: actions/upload-release-asset@v1
if: steps.setup.outputs.need_install == 'true'
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ steps.install.outputs.package_path }}
asset_name: ${{ steps.install.outputs.package_filename }}
asset_content_type: application/gzip
boost:
needs: [_asset, gcc, clang]
strategy:
fail-fast: false
matrix:
version:
- 1.83.0 gcc 13.2.0
- 1.81.0 gcc 12.3.0
- 1.79.0 gcc 11.4.0
- 1.78.0 gcc 11.4.0
- 1.75.0 gcc 11.4.0
- 1.75.0 gcc 10.5.0
- 1.75.0 gcc 9.3.0
- 1.75.0 gcc 8.4.0
- 1.75.0 gcc 7.5.0
- 1.75.0 gcc 6.5.0
- 1.83.0 clang 17.0.1
- 1.81.0 clang 16.0.4
- 1.80.0 clang 15.0.7
- 1.79.0 clang 14.0.6
- 1.78.0 clang 14.0.6
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: asset_info.json
path: asset_info.json
- id: setup
run: ./ga-build/${{ github.job }}/run.sh setup ${{ matrix.version }}
- id: install
if: steps.setup.outputs.need_install == 'true'
run: ./ga-build/${{ github.job }}/run.sh install ${{ matrix.version }}
- uses: actions/upload-release-asset@v1
if: steps.setup.outputs.need_install == 'true'
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ steps.install.outputs.package_path }}
asset_name: ${{ steps.install.outputs.package_filename }}
asset_content_type: application/gzip
# _deploy:
# needs:
# - gcc
# - clang
# - boost
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# # SSH 秘密鍵の登録
# - name: Register SSH key
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# run: |
# mkdir -p $HOME/.ssh
# echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_ed25519
# chmod 600 $HOME/.ssh/id_ed25519
# # デプロイ先を設定する
# - name: Add SSH config
# env:
# SSH_HOST: ${{ secrets.SSH_HOST }}
# SSH_USER: ${{ secrets.SSH_USER }}
# run: |
# echo "Host wandbox" >> $HOME/.ssh/config
# echo " HostName $SSH_HOST" >> $HOME/.ssh/config
# echo " User $SSH_USER" >> $HOME/.ssh/config
# echo " ServerAliveInterval 60" >> $HOME/.ssh/config
# echo " TCPKeepAlive yes" >> $HOME/.ssh/config
# ssh-keyscan -H $SSH_HOST >> $HOME/.ssh/known_hosts
# # ソースをデプロイ先にコピーして、デプロイスクリプトを実行する
# - id: deploy
# name: Deploy
# run: |
# set -ex
# COMMIT=`git log --format=%as.%h -n 1 HEAD`
# ssh wandbox 'mkdir -p /opt/wandbox-data'
# rsync -a -v . wandbox:/opt/wandbox-data/wandbox-builder
# ssh wandbox "python3 /opt/wandbox-data/wandbox-builder/deploy.py $GITHUB_WORKFLOW $COMMIT ${{ env.ASSETS_URL }} --github_token ${{ env.GITHUB_TOKEN }}"
# - name: Generate Configuration
# if: steps.deploy.outputs.deployed == 'true'
# run: |
# ssh wandbox 'mkdir -p /opt/wandbox-data/release/cattleshed-conf'
# ssh wandbox 'python3 /opt/wandbox-data/wandbox-builder/cattleshed-conf/compilers.py > /opt/wandbox-data/release/cattleshed-conf/compilers.default'
# - name: Restart Cattleshed
# if: steps.deploy.outputs.deployed == 'true'
# run: |
# ssh wandbox 'systemctl restart cattleshed-master'
# ssh wandbox 'systemctl restart cattleshed-develop'
# sleep 30
# - name: Restart Kennel
# if: steps.deploy.outputs.deployed == 'true'
# run: |
# ssh wandbox 'systemctl restart kennel-master'
# ssh wandbox 'systemctl restart kennel-develop'