-
Notifications
You must be signed in to change notification settings - Fork 2
143 lines (117 loc) · 4.18 KB
/
Copy pathmain.yml
File metadata and controls
143 lines (117 loc) · 4.18 KB
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: Rolling Release
on:
push:
branches: [ main, master ]
workflow_dispatch:
env:
ROLLING_TAG: "ypp-rolling"
ROLLING_NAME: "Yellow++ Rolling Release"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y bison gcc git make libpng-dev
- name: Checkout RGBDS
uses: actions/checkout@v4
with:
path: rgbds
ref: v1.0.1
repository: gbdev/rgbds
- name: Install RGBDS
working-directory: rgbds
run: sudo make install
- name: Remove RGBDS folder
run: rm -rf rgbds
- name: Set SHORT_SHA
run: echo "SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Build ROMs
run: |
make clean || true
make
# Rename debug ROM and symbol files
cp pokeyellow.gbc ypp_latest.gbc # convenience copy for download badge
mv pokeyellow.gbc "ypp_${SHORT_SHA}.gbc"
mv pokeyellow_debug.gbc "ypp_${SHORT_SHA}_debug.gbc"
mv pokeyellow.sym "ypp_${SHORT_SHA}.sym"
mv pokeyellow_debug.sym "ypp_${SHORT_SHA}_debug.sym"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ypp-build
path: .
retention-days: 7
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load SHORT_SHA
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ypp-build
path: .
- name: Generate changelog
id: changelog
run: |
git fetch --tags
PREV_TAG=$(git tag --sort=-creatordate | grep ypp-rolling | head -n 1)
if [ -z "$PREV_TAG" ]; then
LOG="- Initial build"
else
LOG=$(git log --pretty=format:"- [%h](https://github.com/${GITHUB_REPOSITORY}/commit/%H) %s" ${PREV_TAG}..HEAD)
[ -z "$LOG" ] && LOG="- No changes"
fi
# Multi-line output for GitHub Actions
echo "changes<<EOF" >> $GITHUB_OUTPUT
echo "$LOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Delete previous rolling release
uses: cb80/delrel@latest
with:
tag: ${{ env.ROLLING_TAG }}
- name: Update rolling tag
run: |
git tag -f ${{ env.ROLLING_TAG }}
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ env.ROLLING_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create prerelease
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.ROLLING_TAG }}
name: "${{ env.ROLLING_NAME }}"
body: |
## Build: ${{ env.SHORT_SHA }}
### **ROM to play:** [`ypp_latest.gbc`](https://github.com/mirko93s/yellowplusplus/releases/download/ypp-rolling/ypp_latest.gbc)
**Debug/testing files:**
- `ypp_${{ env.SHORT_SHA }}.gbc` (same as ypp_latest.gbc)
- `ypp_${{ env.SHORT_SHA }}_debug.gbc` (rom for testing/debugging, **NOT** intended for regular play!)
- `ypp_${{ env.SHORT_SHA }}.sym`
- `ypp_${{ env.SHORT_SHA }}_debug.sym`
**Changelog since last rolling build:**
${{ steps.changelog.outputs.changes }}
prerelease: true
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHORT_SHA: ${{ env.SHORT_SHA }}
- name: Upload ROM and symbol files
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.ROLLING_TAG }}
files: |
ypp_latest.gbc
ypp_${{ env.SHORT_SHA }}.gbc
ypp_${{ env.SHORT_SHA }}_debug.gbc
ypp_${{ env.SHORT_SHA }}.sym
ypp_${{ env.SHORT_SHA }}_debug.sym