-
Notifications
You must be signed in to change notification settings - Fork 10
164 lines (157 loc) · 5.02 KB
/
release.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
name: Release
on: workflow_dispatch
permissions:
contents: write
jobs:
release:
name: Create release
runs-on: ubuntu-latest
outputs:
release: ${{ steps.tag.outputs.release }}
version: ${{ steps.tag.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate changelog
uses: TriPSs/conventional-changelog-action@v3
id: changelog
with:
git-push: false
output-file: false
skip-git-pull: true
skip-version-file: true
skip-commit: true
skip-tag: true
- name: Create release
id: tag
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const skipped = '${{ steps.changelog.outputs.skipped }}';
const tag = '${{ steps.changelog.outputs.tag }}';
const version = '${{ steps.changelog.outputs.version }}';
const body = `${{ steps.changelog.outputs.clean_changelog }}`;
if (skipped !== 'false') {
core.setFailed('No changes to publish.');
return;
}
const release = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
name: tag,
body,
});
core.setOutput('version', version);
core.setOutput('release', release.data.id);
fmod:
name: Build FMOD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: ./.github/actions/fmod
- uses: actions/upload-artifact@v3
with:
name: FMOD Build
path: .fmod/Build
build:
name: ${{ matrix.mode }} for ${{ matrix.targetPlatform }}
needs: [ release, fmod ]
runs-on: ubuntu-latest
strategy:
matrix:
targetPlatform:
- StandaloneWindows64
- StandaloneLinux64
- StandaloneOSX
mode: [ Build ]
include:
- targetPlatform: StandaloneWindows64
method: Editor.BuildScript.Build
mode: Dev
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: actions/download-artifact@v3
with:
name: FMOD Build
path: .fmod/Build
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
gitPrivateToken: ${{ secrets.PACKAGES_TOKEN }}
unityVersion: 2022.3.6f1
targetPlatform: ${{ matrix.targetPlatform }}
versioning: Custom
version: ${{ needs.release.outputs.version }}
buildMethod: ${{ matrix.method }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.mode }}-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
- name: Create zip archive
run: |
cd build/${{ matrix.targetPlatform }}
zip -r ../../artifact.zip .
- name: Upload asset
uses: actions/github-script@v6
with:
script: |
const release_id = `${{ needs.release.outputs.release }}`;
const name = `${{ matrix.mode }}-${{ matrix.targetPlatform }}.zip`;
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id,
name,
data: require("fs").readFileSync("artifact.zip"),
});
steam:
name: Deploy to Steam
needs: [ release, build ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download StandaloneWindows64 Artifact
uses: actions/download-artifact@v3
with:
name: Build-StandaloneWindows64
path: build/StandaloneWindows64
- name: Download StandaloneLinux64 Artifact
uses: actions/download-artifact@v3
with:
name: Build-StandaloneLinux64
path: build/StandaloneLinux64
- name: Download StandaloneOSX Artifact
uses: actions/download-artifact@v3
with:
name: Build-StandaloneOSX
path: build/StandaloneOSX
- uses: game-ci/steam-deploy@v3
with:
username: ${{ secrets.STEAM_USERNAME }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
appId: ${{ secrets.STEAM_APP_ID }}
buildDescription: v${{ needs.release.outputs.version }}
rootPath: build
depot1Path: StandaloneWindows64
depot2Path: StandaloneLinux64
depot3Path: StandaloneOSX
releaseBranch: prerelease