-
-
Notifications
You must be signed in to change notification settings - Fork 27
164 lines (162 loc) · 5.78 KB
/
build_engine.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: Build Engine
on:
push:
branches: [ master ]
paths:
- 'engines/**'
jobs:
findengine:
runs-on: ubuntu-latest
outputs:
engine: ${{ steps.findname.outputs.engine }}
container: ${{ steps.findname.outputs.container }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find Engine Name
id: findname
uses: luxtorpeda-dev/action-build-get-engine-name@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
needs: findengine
outputs:
app_ids: ${{env.APP_IDS }}
container:
image: ${{ needs.findengine.outputs.container }}
volumes:
- /usr/share/dotnet:/gh/dotnet
- /opt/ghc:/gh/ghc
- /usr/local/share/boost:/gh/boost
- /usr/local/lib/android:/gh/android
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cleanup GH Environment
run: |
sudo rm -rf /gh/dotnet/*
sudo rm -rf /gh/ghc/*
sudo rm -rf /gh/boost/*
sudo rm -rf /gh/android/*
df -h
- name: Build
run: ./common/start_build.sh ${{needs.findengine.outputs.engine}}
- name: Package
run: ./common/package.sh ${{needs.findengine.outputs.engine}}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist
finddeploy:
needs: [build, findengine]
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
build_number: ${{ steps.buildnumber.outputs.build_number }}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: Generate Matrix
id: matrix
uses: luxtorpeda-dev/action-build-generate-file-matrix@master
with:
name: ${{needs.findengine.outputs.engine}}
- name: Generate build number
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.github_token }}
prefix: ${{needs.findengine.outputs.engine}}
- name: Create Release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.findengine.outputs.engine }}-${{ steps.buildnumber.outputs.build_number }}
name: ${{ needs.findengine.outputs.engine }} Version ${{ steps.buildnumber.outputs.build_number }}
draft: false
prerelease: false
generate_release_notes: true
deploy:
needs: [finddeploy, findengine]
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.finddeploy.outputs.matrix)}}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: Rename Artifact for Release Prep
run: mv "${{needs.findengine.outputs.engine}}/${{ matrix.name }}${{ matrix.extension }}" "${{ matrix.name }}-${{ needs.finddeploy.outputs.build_number }}${{ matrix.extension }}"
- name: Update Release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.findengine.outputs.engine }}-${{ needs.finddeploy.outputs.build_number }}
name: ${{ needs.findengine.outputs.engine }} Version ${{ needs.finddeploy.outputs.build_number }}
draft: false
prerelease: false
generate_release_notes: true
files: "${{ matrix.name }}-${{ needs.finddeploy.outputs.build_number }}${{ matrix.extension }}"
update_packages:
needs: [deploy, finddeploy, findengine, build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
- name: Update packagessniper_v2.json
uses: luxtorpeda-dev/action-build-update-packages@master
with:
matrix: ${{ needs.finddeploy.outputs.matrix }}
version: ${{ needs.finddeploy.outputs.build_number }}
app_ids: ${{ needs.build.outputs.app_ids }}
- name: Commit package.json
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add metadata/packagessniper_v2.json
git commit -m "Update packages.json for ${{ needs.findengine.outputs.engine }} version ${{ needs.finddeploy.outputs.build_number }}"
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Generate Packages Runtime Hash
id: generatehash
uses: luxtorpeda-dev/action-build-generate-sha1-hash@master
with:
file: metadata/packagessniper_v2.json
- name: Generate Packages Hash 256
id: generatehash256
uses: luxtorpeda-dev/action-build-generate-sha256-hash@main
with:
file: metadata/packagessniper_v2.json
- name: Write Packages Hash
uses: DamianReeves/[email protected]
with:
path: metadata/packagessniper_v2.hash
contents: ${{ steps.generatehash.outputs.hash }}
write-mode: overwrite
- name: Write Packages Hash 256
uses: DamianReeves/[email protected]
with:
path: metadata/packagessniper_v2.hash256
contents: ${{ steps.generatehash256.outputs.hash }}
write-mode: overwrite
- name: Publish To Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./metadata
keep_files: true
external_repository: luxtorpeda-dev/luxtorpeda-dev.github.io
publish_branch: master