-
-
Notifications
You must be signed in to change notification settings - Fork 3
173 lines (142 loc) · 4.41 KB
/
push.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
name: Build
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
make_matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout Node
uses: actions/setup-node@v3
with:
node-version: "22"
cache: 'yarn'
- run: yarn install
- run: npx tsc
- run: node ./dist/makeMatrix.js
- id: set-matrix
run: |
JSON=$(cat ./matrix.json)
echo $JSON
echo "matrix=${JSON//'%'/'%25'}" >> $GITHUB_OUTPUT
make_release:
name: Generate Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: get-npm-version
id: package-version
uses: Saionaro/[email protected]
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- id: checkTag
run: git show-ref --tags --verify --quiet -- "refs/tags/v${{ steps.package-version.outputs.version }}" && echo "tagged=1" >> $GITHUB_OUTPUT || echo "tagged=0" >> $GITHUB_OUTPUT
- run: echo ${{ steps.checkTag.outputs.tagged }}
- name: Create Release
id: create_release
if: steps.checkTag.outputs.tagged == 0
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.version }}
release_name: v${{ steps.package-version.outputs.version }}
draft: false
prerelease: true
build:
continue-on-error: true
name: Build
needs: [make_matrix, make_release]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.make_matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout Node
uses: actions/setup-node@v3
with:
node-version: "22"
cache: 'yarn'
# linux
- if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib
# mac
- if:
matrix.os == 'macos-14'
run: brew install p7zip
# windows
- name: Add msbuild to PATH
run: yarn global add --production windows-build-tools --vs2019
# uses: microsoft/[email protected]
if: matrix.os == 'windows-2019'
# nw.js
# - if: matrix.runtime == 'nw.js'
# uses: MatteoH2O1999/setup-python@v1
# with:
# python-version: 2.7.18
# allow-build: info
# cache-build: true
# cache: pip
- if: matrix.runtime == 'nw.js'
uses: actions/setup-python@v4
with:
python-version: 'pypy2.7-v7.3.12'
- if: matrix.os == 'macos-14' && matrix.runtime != 'nw.js'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- if: matrix.runtime == 'nw.js'
run: |
yarn config set python python2.7
yarn config set msvs_version 2019
- run: git clone https://github.com/greenheartgames/greenworks greenworks
- run: gcc -v
- run: g++ -v
# Extract
- run: 7z x sdk.zip -y -p${{ secrets.ZIP_PASSWORD }}
- run: mv sdk greenworks/deps/steamworks_sdk
- run: yarn install
- run: |
cd greenworks
# git apply ../diff.patch
yarn install
cat package.json
- run: ls
# - name: "ls"
# shell: bash
# run:
# ls "${{env.pythonLocation}}"
- run: npx tsc
- name: "Build"
shell: bash
run: |
node dist/index.js --os=${{matrix.os}} --runtime=${{matrix.runtime}} --arch=${{matrix.arch}}
- name: get-npm-version
id: package-version
uses: Saionaro/[email protected]
- name: "ls"
shell: bash
run:
ls greenworks/build/Release/
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: ./artifacts/*
tag: v${{ steps.package-version.outputs.version }}
overwrite: true
file_glob: true
- name: Keepalive Workflow
uses: gautamkrishnar/[email protected]