Skip to content

Commit 9017616

Browse files
committed
Make CI fork friendly
1 parent 38be858 commit 9017616

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push: {}
6+
release:
7+
types: [published]
48

59
env:
610
GMODNET_VERSION: '0.6.0'
@@ -80,19 +84,19 @@ jobs:
8084
# Finilize nightly build for push event
8185

8286
- name: Download GMS
83-
if: github.event_name == 'push'
87+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
8488
run: |
8589
wget https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms
8690
chmod +x gms
8791
8892
- name: Download signature key
89-
if: github.event_name == 'push'
93+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
9094
env:
9195
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
9296
run: git clone https://GlebChili:$GITHUB_TOKEN@github.com/GlebChili/GmodDotNetPrivateKey.git
9397

9498
- name: Sign assemblies
95-
if: github.event_name == 'push'
99+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
96100
run: |
97101
cd build
98102
./../gms --sign=gmcl_dotnet_linux64.dll --key=../GmodDotNetPrivateKey/gmodnet-private.modulekey --version=$GMODNET_VERSION
@@ -106,19 +110,19 @@ jobs:
106110
mv gmodnet-public.modulekey GmodNET.modulekey
107111
108112
- name: Pack build
109-
if: github.event_name == 'push'
113+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
110114
env:
111115
TRAVIS_COMMIT: ${{ github.sha }}
112116
run: |
113117
cd build
114118
tar czfv ../linux-$TRAVIS_COMMIT.tar.gz .
115119
116120
- name: Pack with MSBuild
117-
if: github.event_name == 'push'
121+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
118122
run: dotnet build runtime.csproj -target:PackRuntimeBuild
119123

120124
- name: Upload versioned build as artifact
121-
if: github.event_name == 'push'
125+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
122126
uses: actions/upload-artifact@v1.0.0
123127
with:
124128
name: linux-versioned-build
@@ -196,19 +200,19 @@ jobs:
196200
# Finilize full signed build on push
197201

198202
- name: Download GMS
199-
if: github.event_name == 'push'
203+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
200204
shell: bash
201205
run: curl -O -L https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms.exe
202206

203207
- name: Download signature key
204-
if: github.event_name == 'push'
208+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
205209
shell: bash
206210
env:
207211
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
208212
run: git clone https://GlebChili:$GITHUB_TOKEN@github.com/GlebChili/GmodDotNetPrivateKey.git
209213

210214
- name: Sign assemblies
211-
if: github.event_name == 'push'
215+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
212216
shell: bash
213217
run: |
214218
cd build
@@ -223,11 +227,11 @@ jobs:
223227
mv gmodnet-public.modulekey GmodNET.modulekey
224228
225229
- name: Pack with MSBuild
226-
if: github.event_name == 'push'
230+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
227231
run: dotnet build runtime.csproj -target:PackRuntimeBuild
228232

229233
- name: Upload versioned build as artifact
230-
if: github.event_name == 'push'
234+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
231235
uses: actions/upload-artifact@v1.0.0
232236
with:
233237
name: windows-versioned-build
@@ -259,19 +263,19 @@ jobs:
259263
# Finilize full signed build on push
260264

261265
- name: Download GMS
262-
if: github.event_name == 'push'
266+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
263267
run: |
264268
curl -O -L https://github.com/GlebChili/GmodNetModuleSigner/releases/download/1.0.0/gms-osx
265269
chmod +x gms-osx
266270
267271
- name: Download signature key
268-
if: github.event_name == 'push'
272+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
269273
env:
270274
GITHUB_TOKEN: ${{ secrets.GMOD_NET_PRIVATE_KEY_REPO_TOKEN }}
271275
run: git clone https://GlebChili:$GITHUB_TOKEN@github.com/GlebChili/GmodDotNetPrivateKey.git
272276

273277
- name: Sign assemblies
274-
if: github.event_name == 'push'
278+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
275279
run: |
276280
cd build
277281
./../gms-osx --sign=gmcl_dotnet_osx64.dll --key=../GmodDotNetPrivateKey/gmodnet-private.modulekey --version=$GMODNET_VERSION
@@ -285,11 +289,11 @@ jobs:
285289
mv gmodnet-public.modulekey GmodNET.modulekey
286290
287291
- name: Pack with MSBuild
288-
if: github.event_name == 'push'
292+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
289293
run: dotnet build runtime.csproj -target:PackRuntimeBuild
290294

291295
- name: Upload versioned build as artifact
292-
if: github.event_name == 'push'
296+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
293297
uses: actions/upload-artifact@v1.0.0
294298
with:
295299
name: osx-versioned-build
@@ -301,7 +305,7 @@ jobs:
301305

302306
needs: [linux-build, windows-build, mac-build]
303307

304-
if: github.event_name == 'push'
308+
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GmodNET' }}
305309

306310
steps:
307311

0 commit comments

Comments
 (0)