Skip to content

Commit 1234e2c

Browse files
authored
Preparations for 2.1 (#1306)
1 parent d7f39aa commit 1234e2c

19 files changed

+261
-135
lines changed

.github/getversion.cpp

-9
This file was deleted.

.github/workflows/build.yml

+19-47
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Build Cemu
33
on:
44
workflow_call:
55
inputs:
6-
deploymode:
6+
next_version_major:
77
required: false
88
type: string
9-
experimentalversion:
9+
next_version_minor:
1010
required: false
1111
type: string
1212

@@ -24,25 +24,17 @@ jobs:
2424
submodules: "recursive"
2525
fetch-depth: 0
2626

27-
- name: Setup release mode parameters (for deploy)
28-
if: ${{ inputs.deploymode == 'release' }}
27+
- name: Setup release mode parameters
2928
run: |
3029
echo "BUILD_MODE=release" >> $GITHUB_ENV
3130
echo "BUILD_FLAGS=" >> $GITHUB_ENV
3231
echo "Build mode is release"
3332
34-
- name: Setup debug mode parameters (for continous build)
35-
if: ${{ inputs.deploymode != 'release' }}
33+
- name: Setup build flags for version
34+
if: ${{ inputs.next_version_major != '' }}
3635
run: |
37-
echo "BUILD_MODE=debug" >> $GITHUB_ENV
38-
echo "BUILD_FLAGS=" >> $GITHUB_ENV
39-
echo "Build mode is debug"
40-
41-
- name: Setup version for experimental
42-
if: ${{ inputs.experimentalversion != '' }}
43-
run: |
44-
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
45-
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
36+
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
37+
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" >> $GITHUB_ENV
4638
4739
- name: "Install system dependencies"
4840
run: |
@@ -81,12 +73,10 @@ jobs:
8173
cmake --build build
8274
8375
- name: Prepare artifact
84-
if: ${{ inputs.deploymode == 'release' }}
8576
run: mv bin/Cemu_release bin/Cemu
8677

8778
- name: Upload artifact
8879
uses: actions/upload-artifact@v4
89-
if: ${{ inputs.deploymode == 'release' }}
9080
with:
9181
name: cemu-bin-linux-x64
9282
path: ./bin/Cemu
@@ -128,24 +118,17 @@ jobs:
128118
with:
129119
submodules: "recursive"
130120

131-
- name: Setup release mode parameters (for deploy)
132-
if: ${{ inputs.deploymode == 'release' }}
121+
- name: Setup release mode parameters
133122
run: |
134123
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
135124
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
136125
echo "Build mode is release"
137-
138-
- name: Setup debug mode parameters (for continous build)
139-
if: ${{ inputs.deploymode != 'release' }}
140-
run: |
141-
echo "BUILD_MODE=debug" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
142-
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
143-
echo "Build mode is debug"
144-
- name: Setup version for experimental
145-
if: ${{ inputs.experimentalversion != '' }}
126+
127+
- name: Setup build flags for version
128+
if: ${{ inputs.next_version_major != '' }}
146129
run: |
147-
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
148-
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
130+
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
131+
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
149132
150133
- name: "Setup cmake"
151134
uses: jwlawson/actions-setup-cmake@v2
@@ -184,12 +167,10 @@ jobs:
184167
cmake --build . --config ${{ env.BUILD_MODE }}
185168
186169
- name: Prepare artifact
187-
if: ${{ inputs.deploymode == 'release' }}
188170
run: Rename-Item bin/Cemu_release.exe Cemu.exe
189171

190172
- name: Upload artifact
191173
uses: actions/upload-artifact@v4
192-
if: ${{ inputs.deploymode == 'release' }}
193174
with:
194175
name: cemu-bin-windows-x64
195176
path: ./bin/Cemu.exe
@@ -202,24 +183,17 @@ jobs:
202183
with:
203184
submodules: "recursive"
204185

205-
- name: Setup release mode parameters (for deploy)
206-
if: ${{ inputs.deploymode == 'release' }}
186+
- name: Setup release mode parameters
207187
run: |
208188
echo "BUILD_MODE=release" >> $GITHUB_ENV
209189
echo "BUILD_FLAGS=" >> $GITHUB_ENV
210190
echo "Build mode is release"
211-
- name: Setup debug mode parameters (for continous build)
212-
if: ${{ inputs.deploymode != 'release' }}
213-
run: |
214-
echo "BUILD_MODE=debug" >> $GITHUB_ENV
215-
echo "BUILD_FLAGS=" >> $GITHUB_ENV
216-
echo "Build mode is debug"
217-
218-
- name: Setup version for experimental
219-
if: ${{ inputs.experimentalversion != '' }}
191+
192+
- name: Setup build flags for version
193+
if: ${{ inputs.next_version_major != '' }}
220194
run: |
221-
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
222-
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
195+
echo "[INFO] Version ${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}"
196+
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEMULATOR_VERSION_MAJOR=${{ inputs.next_version_major }} -DEMULATOR_VERSION_MINOR=${{ inputs.next_version_minor }}" >> $GITHUB_ENV
223197
224198
- name: "Install system dependencies"
225199
run: |
@@ -275,7 +249,6 @@ jobs:
275249
cmake --build build
276250
277251
- name: Prepare artifact
278-
if: ${{ inputs.deploymode == 'release' }}
279252
run: |
280253
mkdir bin/Cemu_app
281254
mv bin/Cemu_release.app bin/Cemu_app/Cemu.app
@@ -289,7 +262,6 @@ jobs:
289262
290263
- name: Upload artifact
291264
uses: actions/upload-artifact@v4
292-
if: ${{ inputs.deploymode == 'release' }}
293265
with:
294266
name: cemu-bin-macos-x64
295267
path: ./bin/Cemu.dmg

.github/workflows/build_check.yml

-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ on:
1616
jobs:
1717
build:
1818
uses: ./.github/workflows/build.yml
19-
with:
20-
deploymode: release
21-
experimentalversion: 999999

.github/workflows/deploy_experimental_release.yml

+79-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,83 @@
11
name: Deploy experimental release
22
on:
33
workflow_dispatch:
4+
inputs:
5+
changelog0:
6+
description: 'Enter the changelog lines for this release. Each line is a feature / bullet point. Do not use dash.'
7+
required: true
8+
type: string
9+
changelog1:
10+
description: 'Feature 2'
11+
required: false
12+
type: string
13+
changelog2:
14+
description: 'Feature 3'
15+
required: false
16+
type: string
17+
changelog3:
18+
description: 'Feature 4'
19+
required: false
20+
type: string
21+
changelog4:
22+
description: 'Feature 5'
23+
required: false
24+
type: string
25+
changelog5:
26+
description: 'Feature 6'
27+
required: false
28+
type: string
29+
changelog6:
30+
description: 'Feature 7'
31+
required: false
32+
type: string
33+
changelog7:
34+
description: 'Feature 8'
35+
required: false
36+
type: string
37+
changelog8:
38+
description: 'Feature 9'
39+
required: false
40+
type: string
41+
changelog9:
42+
description: 'Feature 10'
43+
required: false
44+
type: string
445

546
jobs:
47+
calculate-version:
48+
name: Calculate Version
49+
uses: ./.github/workflows/determine_release_version.yml
650
call-release-build:
751
uses: ./.github/workflows/build.yml
52+
needs: calculate-version
853
with:
9-
deploymode: release
10-
experimentalversion: ${{ github.run_number }}
54+
next_version_major: ${{ needs.calculate-version.outputs.next_version_major }}
55+
next_version_minor: ${{ needs.calculate-version.outputs.next_version_minor }}
1156
deploy:
1257
name: Deploy experimental release
1358
runs-on: ubuntu-22.04
14-
needs: call-release-build
59+
needs: [call-release-build, calculate-version]
1560
steps:
16-
- uses: actions/checkout@v3
17-
61+
- uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0
64+
65+
- name: Generate changelog
66+
id: generate_changelog
67+
run: |
68+
CHANGELOG=""
69+
if [ -n "${{ github.event.inputs.changelog0 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog0 }}\n"; fi
70+
if [ -n "${{ github.event.inputs.changelog1 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog1 }}\n"; fi
71+
if [ -n "${{ github.event.inputs.changelog2 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog2 }}\n"; fi
72+
if [ -n "${{ github.event.inputs.changelog3 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog3 }}\n"; fi
73+
if [ -n "${{ github.event.inputs.changelog4 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog4 }}\n"; fi
74+
if [ -n "${{ github.event.inputs.changelog5 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog5 }}\n"; fi
75+
if [ -n "${{ github.event.inputs.changelog6 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog6 }}\n"; fi
76+
if [ -n "${{ github.event.inputs.changelog7 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog7 }}\n"; fi
77+
if [ -n "${{ github.event.inputs.changelog8 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog8 }}\n"; fi
78+
if [ -n "${{ github.event.inputs.changelog9 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog9 }}\n"; fi
79+
echo -e "$CHANGELOG"
80+
echo "RELEASE_BODY=$CHANGELOG" >> $GITHUB_ENV
1881
- uses: actions/download-artifact@v4
1982
with:
2083
name: cemu-bin-linux-x64
@@ -40,15 +103,13 @@ jobs:
40103
mkdir upload
41104
sudo apt install zip
42105
43-
- name: Get version
106+
- name: Set version dependent vars
44107
run: |
45-
echo "Experimental version: ${{ github.run_number }}"
46-
ls
47-
gcc -o getversion .github/getversion.cpp
48-
./getversion
49-
echo "Cemu CI version: $(./getversion)"
50-
echo "CEMU_FOLDER_NAME=Cemu_$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV
51-
echo "CEMU_VERSION=$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV
108+
echo "Version: ${{ needs.calculate-version.outputs.next_version }}"
109+
echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}"
110+
echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}"
111+
echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV
112+
echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV
52113
53114
- name: Create release from windows-bin
54115
run: |
@@ -83,4 +144,8 @@ jobs:
83144
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz
84145
tar xvzf ghr.tar.gz; rm ghr.tar.gz
85146
echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}"
86-
ghr_v0.15.0_linux_amd64/ghr -prerelease -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }} (Experimental)" -b "Cemu experimental release" "v${{ env.CEMU_VERSION }}" ./upload
147+
CHANGELOG_UNESCAPED=$(printf "%s\n" "${{ env.RELEASE_BODY }}" | sed 's/\\n/\n/g')
148+
RELEASE_BODY=$(printf "%s\n%s" \
149+
"**Changelog:**" \
150+
"$CHANGELOG_UNESCAPED")
151+
ghr_v0.15.0_linux_amd64/ghr -draft -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" -b "$RELEASE_BODY" "v${{ env.CEMU_VERSION }}" ./upload
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Calculate Next Version from release history
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
outputs:
7+
next_version:
8+
description: "The next semantic version"
9+
value: ${{ jobs.calculate-version.outputs.next_version }}
10+
next_version_major:
11+
description: "The next semantic version (major)"
12+
value: ${{ jobs.calculate-version.outputs.next_version_major }}
13+
next_version_minor:
14+
description: "The next semantic version (minor)"
15+
value: ${{ jobs.calculate-version.outputs.next_version_minor }}
16+
17+
jobs:
18+
calculate-version:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
next_version: ${{ steps.calculate_next_version.outputs.next_version }}
22+
next_version_major: ${{ steps.calculate_next_version.outputs.next_version_major }}
23+
next_version_minor: ${{ steps.calculate_next_version.outputs.next_version_minor }}
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Get all releases
29+
id: get_all_releases
30+
run: |
31+
# Fetch all releases and check for API errors
32+
RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=100")
33+
if [ "$RESPONSE" -ne 200 ]; then
34+
echo "Failed to fetch releases. HTTP status: $RESPONSE"
35+
cat response.json
36+
exit 1
37+
fi
38+
39+
# Extract and sort tags
40+
ALL_TAGS=$(jq -r '.[].tag_name' response.json | grep -E '^v[0-9]+\.[0-9]+(-[0-9]+)?$' | sed 's/-.*//' | sort -V | tail -n 1)
41+
42+
# Exit if no tags were found
43+
if [ -z "$ALL_TAGS" ]; then
44+
echo "No valid tags found."
45+
exit 1
46+
fi
47+
48+
echo "::set-output name=tag::$ALL_TAGS"
49+
# echo "tag=$ALL_TAGS" >> $GITHUB_STATE
50+
51+
- name: Calculate next semver minor
52+
id: calculate_next_version
53+
run: |
54+
LATEST_VERSION=${{ steps.get_all_releases.outputs.tag }}
55+
56+
# strip 'v' prefix and split into major.minor
57+
LATEST_VERSION=${LATEST_VERSION//v/}
58+
IFS='.' read -r -a VERSION_PARTS <<< "$LATEST_VERSION"
59+
60+
MAJOR=${VERSION_PARTS[0]}
61+
MINOR=${VERSION_PARTS[1]}
62+
63+
# increment the minor version
64+
MINOR=$((MINOR + 1))
65+
66+
NEXT_VERSION="${MAJOR}.${MINOR}"
67+
68+
echo "Major: $MAJOR"
69+
echo "Minor: $MINOR"
70+
71+
echo "Next version: $NEXT_VERSION"
72+
echo "::set-output name=next_version::$NEXT_VERSION"
73+
echo "::set-output name=next_version_major::$MAJOR"
74+
echo "::set-output name=next_version_minor::$MINOR"

0 commit comments

Comments
 (0)