-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (136 loc) · 4.63 KB
/
build.yaml
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
name: build
on: push
jobs:
test-build-system:
runs-on: ubuntu-20.04
steps:
- name: Checkout undercooked
uses: actions/checkout@v2
with:
path: undercooked
- name: Test jinja2 template renderer
working-directory: undercooked/meta
run: python3 -m doctest -v jinja2_render.py
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout rgbds
uses: actions/checkout@v2
with:
repository: rednex/rgbds
ref: v0.5.1
path: rgbds
- name: Build rgbds
working-directory: rgbds
run: make -j 2 Q= CC=gcc
- name: Install rgbds
working-directory: rgbds
run: sudo make -j 2 Q= install
- name: Package rgbds
working-directory: rgbds
run: |
mkdir bins
cp rgb{asm,link,fix,gfx} bins
- name: Upload binaries
uses: actions/upload-artifact@v1
with:
name: rgbds
path: rgbds/bins
- name: Download ninja binary
run: curl -LO https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
- name: Extract ninja binary
run: unzip ninja-linux.zip
- name: Install ninja
run: sudo install ninja /usr/local/bin/
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install pipenv
run: pip install pipenv
- name: Checkout undercooked
uses: actions/checkout@v2
with:
path: undercooked
- name: Prepare build system
working-directory: undercooked
run: ./configure
- name: Build undercooked
working-directory: undercooked
run: ninja
- name: Move undercooked ROM into project directory
working-directory: undercooked
run: mv obj/main.gb undercooked_${{ github.sha }}.gb
- name: Upload undercooked ROM as build artifact
uses: actions/upload-artifact@v1
with:
name: undercooked_${{ github.sha }}.gb
path: undercooked/undercooked_${{ github.sha }}.gb
- name: Upload remaining undercooked build artifacts
uses: actions/upload-artifact@v1
with:
name: obj
path: undercooked/obj
github-release:
needs: build
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Calculate new version
uses: frabert/[email protected]
with:
string: ${{ github.ref }}
pattern: 'refs/tags/v'
replace-with: ''
id: version
- uses: actions/download-artifact@v2
with:
name: undercooked_${{ github.sha }}.gb
- name: Create Github release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
[_Play this version directly in your browser_](https://qguv.github.io/undercooked/play/${{ steps.version.outputs.replaced }})
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.version.outputs.replaced }}
draft: true
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0.') }}
id: create_release
- name: Upload undercooked ROM as release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: undercooked_${{ github.sha }}.gb
asset_name: undercooked_${{ steps.version.outputs.replaced }}.gb
asset_content_type: application/octet-stream
gh-pages-release:
runs-on: ubuntu-20.04
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Calculate new version
uses: frabert/[email protected]
with:
string: ${{ github.ref }}
pattern: 'refs/tags/v'
replace-with: ''
id: version
- uses: actions/download-artifact@v2
with:
name: undercooked_${{ github.sha }}.gb
- name: Create new web emulator demo page
run: |
mkdir -p gh-pages/_posts gh-pages/releases
touch "gh-pages/_posts/$(date +%Y-%m-%d-${{ steps.version.outputs.replaced }}.md)"
mv undercooked_${{ github.sha }}.gb gh-pages/releases/undercooked_${{ steps.version.outputs.replaced }}.gb
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: gh-pages/
keep_files: true
enable_jekyll: true