-
Notifications
You must be signed in to change notification settings - Fork 33
130 lines (128 loc) · 4.82 KB
/
build-node.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: Node
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
nodejs:
needs: [_asset]
strategy:
fail-fast: false
matrix:
version:
- 20.17.0
- 18.20.4
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
typescript:
needs: [_asset, nodejs]
strategy:
fail-fast: false
matrix:
version:
- 5.6.2 nodejs 20.17.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
# _deploy:
# needs:
# - nodejs
# - typescript
# 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'