forked from cemu-project/Cemu
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
162 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,4 @@ jobs: | |
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
deploymode: release | ||
experimentalversion: 999999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,94 @@ | ||
name: Deploy experimental release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
changelog0: | ||
description: 'Enter the changelog lines for this release. Each line is a feature / bullet point. Do not use dash.' | ||
required: true | ||
type: string | ||
changelog1: | ||
description: 'Feature 2' | ||
required: false | ||
type: string | ||
changelog2: | ||
description: 'Feature 3' | ||
required: false | ||
type: string | ||
changelog3: | ||
description: 'Feature 4' | ||
required: false | ||
type: string | ||
changelog4: | ||
description: 'Feature 5' | ||
required: false | ||
type: string | ||
changelog5: | ||
description: 'Feature 6' | ||
required: false | ||
type: string | ||
changelog6: | ||
description: 'Feature 7' | ||
required: false | ||
type: string | ||
changelog7: | ||
description: 'Feature 8' | ||
required: false | ||
type: string | ||
changelog8: | ||
description: 'Feature 9' | ||
required: false | ||
type: string | ||
changelog9: | ||
description: 'Feature 10' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
call-release-build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
deploymode: release | ||
experimentalversion: ${{ github.run_number }} | ||
deploy: | ||
name: Deploy experimental release | ||
runs-on: ubuntu-22.04 | ||
needs: call-release-build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use GitVersion to generate version | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '6.x' | ||
|
||
- name: Determine version via GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
overrideConfig: | | ||
semantic-version-format: Loose | ||
increment: Minor | ||
- name: Generate changelog | ||
id: generate_changelog | ||
run: | | ||
CHANGELOG="" | ||
if [ -n "${{ github.event.inputs.changelog0 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog0 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog1 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog1 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog2 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog2 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog3 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog3 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog4 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog4 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog5 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog5 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog6 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog6 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog7 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog7 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog8 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog8 }}\n"; fi | ||
if [ -n "${{ github.event.inputs.changelog9 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog9 }}\n"; fi | ||
echo -e "$CHANGELOG" | ||
echo "$CHANGELOG" > changelog.txt | ||
RELEASE_BODY=$(<changelog.txt) | ||
echo -e "RELEASE_BODY=$RELEASE_BODY" >> $GITHUB_ENV | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: cemu-bin-linux-x64 | ||
|
@@ -40,6 +114,13 @@ jobs: | |
mkdir upload | ||
sudo apt install zip | ||
- name: Get version (via gitversion) | ||
run: | | ||
echo "Version from GitVersion: ${{ steps.gitversion.outputs.fullsemver }}" | ||
echo "Version from GitVersion (Major.Minor): ${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" | ||
echo "CEMU_FOLDER_NAME=Cemu_${{ steps.gitversion.outputs.fullsemver }}" >> $GITHUB_ENV | ||
echo "CEMU_VERSION=${{ steps.gitversion.outputs.fullsemver }}" >> $GITHUB_ENV | ||
- name: Get version | ||
run: | | ||
echo "Experimental version: ${{ github.run_number }}" | ||
|
@@ -83,4 +164,10 @@ jobs: | |
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz | ||
tar xvzf ghr.tar.gz; rm ghr.tar.gz | ||
echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}" | ||
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 | ||
RELEASE_BODY=$(printf "%s\n%s\n\n%s\n\n%s\n%s" \ | ||
"Cemu ${{ env.CEMU_VERSION }} (Experimental)" \ | ||
"" \ | ||
"This is an experimental release." \ | ||
"" \ | ||
"${{ env.RELEASE_BODY }}") | ||
ghr_v0.15.0_linux_amd64/ghr -prerelease -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }} (Experimental)" -b "$RELEASE_BODY" "v${{ env.CEMU_VERSION }}" ./upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Calculate Next Semver Based on All Releases | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
calculate-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get all releases | ||
id: get_all_releases | ||
run: | | ||
# Fetch all releases and check for API errors | ||
RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=100") | ||
if [ "$RESPONSE" -ne 200 ]; then | ||
echo "Failed to fetch releases. HTTP status: $RESPONSE" | ||
cat response.json | ||
exit 1 | ||
fi | ||
# Extract and sort tags | ||
ALL_TAGS=$(jq -r '.[].tag_name' response.json | grep -E '^v[0-9]+\.[0-9]+(-[0-9]+)?$' | sed 's/-.*//' | sort -V | tail -n 1) | ||
# Exit if no tags were found | ||
if [ -z "$ALL_TAGS" ]; then | ||
echo "No valid tags found." | ||
exit 1 | ||
fi | ||
echo "::set-output name=tag::$ALL_TAGS" | ||
- name: Calculate next semver | ||
id: calculate_next_version | ||
run: | | ||
LATEST_VERSION=${{ steps.get_all_releases.outputs.tag }} | ||
# Strip 'v' prefix and split into major.minor | ||
LATEST_VERSION=${LATEST_VERSION//v/} | ||
IFS='.' read -r -a VERSION_PARTS <<< "$LATEST_VERSION" | ||
MAJOR=${VERSION_PARTS[0]} | ||
MINOR=${VERSION_PARTS[1]} | ||
# Increment the minor version | ||
MINOR=$((MINOR + 1)) | ||
# Construct the next version as v<major>.<minor> | ||
NEXT_VERSION="v${MAJOR}.${MINOR}" | ||
echo "Next version: $NEXT_VERSION" | ||
echo "::set-output name=next_version::$NEXT_VERSION" | ||
# access as: ${{ steps.calculate_next_version.outputs.next_version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters