Skip to content

Commit

Permalink
CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
Exzap committed Aug 16, 2024
1 parent 958137a commit 10dcfe3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 39 deletions.
41 changes: 5 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Build Cemu
on:
workflow_call:
inputs:
deploymode:
required: false
type: string
experimentalversion:
required: false
type: string
Expand All @@ -24,20 +21,12 @@ jobs:
submodules: "recursive"
fetch-depth: 0

- name: Setup release mode parameters (for deploy)
if: ${{ inputs.deploymode == 'release' }}
- name: Setup release mode parameters
run: |
echo "BUILD_MODE=release" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
run: |
echo "BUILD_MODE=debug" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is debug"
- name: Setup version for experimental
if: ${{ inputs.experimentalversion != '' }}
run: |
Expand Down Expand Up @@ -81,12 +70,10 @@ jobs:
cmake --build build
- name: Prepare artifact
if: ${{ inputs.deploymode == 'release' }}
run: mv bin/Cemu_release bin/Cemu

- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ inputs.deploymode == 'release' }}
with:
name: cemu-bin-linux-x64
path: ./bin/Cemu
Expand Down Expand Up @@ -128,19 +115,12 @@ jobs:
with:
submodules: "recursive"

- name: Setup release mode parameters (for deploy)
if: ${{ inputs.deploymode == 'release' }}
- name: Setup release mode parameters
run: |
echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
run: |
echo "BUILD_MODE=debug" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "Build mode is debug"
- name: Setup version for experimental
if: ${{ inputs.experimentalversion != '' }}
run: |
Expand Down Expand Up @@ -184,12 +164,10 @@ jobs:
cmake --build . --config ${{ env.BUILD_MODE }}
- name: Prepare artifact
if: ${{ inputs.deploymode == 'release' }}
run: Rename-Item bin/Cemu_release.exe Cemu.exe

- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ inputs.deploymode == 'release' }}
with:
name: cemu-bin-windows-x64
path: ./bin/Cemu.exe
Expand All @@ -202,19 +180,12 @@ jobs:
with:
submodules: "recursive"

- name: Setup release mode parameters (for deploy)
if: ${{ inputs.deploymode == 'release' }}
- name: Setup release mode parameters
run: |
echo "BUILD_MODE=release" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is release"
- name: Setup debug mode parameters (for continous build)
if: ${{ inputs.deploymode != 'release' }}
run: |
echo "BUILD_MODE=debug" >> $GITHUB_ENV
echo "BUILD_FLAGS=" >> $GITHUB_ENV
echo "Build mode is debug"
- name: Setup version for experimental
if: ${{ inputs.experimentalversion != '' }}
run: |
Expand Down Expand Up @@ -275,7 +246,6 @@ jobs:
cmake --build build
- name: Prepare artifact
if: ${{ inputs.deploymode == 'release' }}
run: |
mkdir bin/Cemu_app
mv bin/Cemu_release.app bin/Cemu_app/Cemu.app
Expand All @@ -289,7 +259,6 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ inputs.deploymode == 'release' }}
with:
name: cemu-bin-macos-x64
path: ./bin/Cemu.dmg
1 change: 0 additions & 1 deletion .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ jobs:
build:
uses: ./.github/workflows/build.yml
with:
deploymode: release
experimentalversion: 999999
55 changes: 53 additions & 2 deletions .github/workflows/deploy_experimental_release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Deploy experimental release
on:
workflow_dispatch:
inputs:
changelog:
description: 'Enter the changelog for this release'
required: true
type: string

jobs:
call-release-build:
uses: ./.github/workflows/build.yml
with:
deploymode: release
experimentalversion: ${{ github.run_number }}
deploy:
name: Deploy experimental release
Expand All @@ -15,6 +19,40 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use GitVersion to generate version
id: gitversion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
useConfigFile: false

- name: Get commit messages since last release
id: get_commits
uses: actions/github-script@v6
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
if (!releases.data.length) {
console.log("No releases found.");
return "No previous release found.";
}
const latestRelease = releases.data[0];
console.log(`Latest release found: ${latestRelease.tag_name} published at ${latestRelease.published_at}`);
const { data: commits } = await github.rest.repos.listCommits({
owner: context.repo.owner,
repo: context.repo.repo,
since: latestRelease.published_at,
});
const commitTitles = commits.map(commit => `- ${commit.commit.message.split('\n')[0]}`).join('\n');
return commitTitles;
result-encoding: string

- uses: actions/download-artifact@v4
with:
name: cemu-bin-linux-x64
Expand All @@ -40,6 +78,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 }}"
Expand Down Expand Up @@ -83,4 +128,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." \
"" \
"${{ github.event.inputs.changelog }}")
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

0 comments on commit 10dcfe3

Please sign in to comment.