-
Notifications
You must be signed in to change notification settings - Fork 6
143 lines (136 loc) · 4.39 KB
/
build-and-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
name: build and release
on: push
env:
ARTIFACTS_PATH: artifacts
ZIP_ARTIFACT_NAME: game-boy-test-roms.zip
jobs:
# make the tools required for some build jobs
tools:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tool: [ rgbds, wla-dx ]
steps:
- uses: actions/checkout@v4
- run: |
src/assemble.sh ${{ matrix.tool }}
ls ${{ env.ARTIFACTS_PATH }} -lsah
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ matrix.tool }}
path: ${{ env.ARTIFACTS_PATH }}
# build test roms using the tools created above
test-roms:
runs-on: ubuntu-latest
needs: [ tools ]
strategy:
fail-fast: false
matrix:
suite:
- age-test-roms
- bully
- cgb-acid-hell
- cgb-acid2
- dmg-acid2
- gbmicrotest
- little-things-gb
- mbc3-tester
- mealybug-tearoom-tests
- mooneye-test-suite
- same-suite
- strikethrough
- turtle-tests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: artifact-tools-*
path: ${{ env.ARTIFACTS_PATH }}
merge-multiple: true
- run: |
src/assemble.sh ${{ matrix.suite }}
ls ${{ env.ARTIFACTS_PATH }} -lsah
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ matrix.suite }}
path: ${{ env.ARTIFACTS_PATH }}
# build test roms (no tools required)
test-roms-no-tools:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite: [ blargg-roms, gambatte-roms, mooneye-test-suite-wilbertpol, rtc3test ]
steps:
- uses: actions/checkout@v4
- run: |
src/assemble.sh ${{ matrix.suite }}
ls ${{ env.ARTIFACTS_PATH }} -lsah
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ github.job }}-${{ matrix.suite }}
path: ${{ env.ARTIFACTS_PATH }}
# create a releasable zip
create-release-zip:
name: create release zip
runs-on: ubuntu-latest
needs: [ test-roms, test-roms-no-tools ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{ env.ARTIFACTS_PATH }}
merge-multiple: true
- run: |
src/assemble.sh release-zip $ZIP_ARTIFACT_NAME
ls ${{ env.ARTIFACTS_PATH }} -lsah
- uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_ARTIFACT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}/${{ env.ZIP_ARTIFACT_NAME }}
# Releases are created automatically for each pushed tag.
# Creating a new tag without any additional release information is
# (as of 2020-06-13) not possible using the github.com website.
# Instead, create a new tag via CLI:
# git tag -a v1.0 -m "release v1.0"
# git push origin --tags
#
# Release preparations:
# - adjust CHANGELOG.md
# - adjust README.md (readme link)
# - push new tag
#
upload-new-release:
name: upload new release
runs-on: ubuntu-latest
needs: [ create-release-zip ]
if: startsWith( github.ref, 'refs/tags/v' )
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.ZIP_ARTIFACT_NAME }}
path: ./
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above,
# referencing its ID to get its outputs object,
# which include a `upload_url`.
# See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.ZIP_ARTIFACT_NAME }}
asset_name: game-boy-test-roms-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip