mirror of https://github.com/PCSX2/pcsx2.git
CI: fix flatpak cron and add a way to manually kick off a release (#10567)
* CI: fix mistake stopping flatpak cron from running * CI: add a way to manually kick off releases with a custom tag * cmake: handle edge-case where a commit can have multiple tags * CI: set release channel appropriately when it's a stable release
This commit is contained in:
parent
3d64f4a548
commit
da28e2cc37
|
@ -33,6 +33,7 @@ jobs:
|
||||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||||
with:
|
with:
|
||||||
jobName: "Qt"
|
jobName: "Qt"
|
||||||
|
artifactPrefixName: "PCSX2-linux-Qt-x64-flatpak"
|
||||||
compiler: clang
|
compiler: clang
|
||||||
cmakeflags: ""
|
cmakeflags: ""
|
||||||
publish: true
|
publish: true
|
||||||
|
|
|
@ -39,6 +39,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
stableBuild:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_linux:
|
build_linux:
|
||||||
|
@ -59,6 +63,13 @@ jobs:
|
||||||
if: ${{ inputs.fetchTags }}
|
if: ${{ inputs.fetchTags }}
|
||||||
run: git fetch --tags --no-recurse-submodules
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
- name: Add stable release identifier file
|
||||||
|
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
|
||||||
- name: Prepare Artifact Metadata
|
- name: Prepare Artifact Metadata
|
||||||
id: artifact-metadata
|
id: artifact-metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -39,6 +39,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
stableBuild:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_linux:
|
build_linux:
|
||||||
|
@ -72,6 +76,13 @@ jobs:
|
||||||
if: ${{ inputs.fetchTags }}
|
if: ${{ inputs.fetchTags }}
|
||||||
run: git fetch --tags --no-recurse-submodules
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
- name: Add stable release identifier file
|
||||||
|
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
|
||||||
- name: Prepare Artifact Metadata
|
- name: Prepare Artifact Metadata
|
||||||
id: artifact-metadata
|
id: artifact-metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -21,6 +21,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
stableBuild:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_macos:
|
build_macos:
|
||||||
|
@ -47,6 +51,13 @@ jobs:
|
||||||
if: ${{ inputs.fetchTags }}
|
if: ${{ inputs.fetchTags }}
|
||||||
run: git fetch --tags --no-recurse-submodules
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
- name: Add stable release identifier file
|
||||||
|
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
|
||||||
- name: Use Xcode 14.3.1
|
- name: Use Xcode 14.3.1
|
||||||
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
|
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
|
||||||
|
|
||||||
|
|
|
@ -10,16 +10,19 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
# TODO - future work
|
workflow_dispatch:
|
||||||
# workflow_dispatch:
|
inputs:
|
||||||
# inputs:
|
is_prelease:
|
||||||
# isStable:
|
description: 'Should be a pre-release?'
|
||||||
# description: 'Should it be a stable release?'
|
required: true
|
||||||
# required: true
|
default: 'true'
|
||||||
# default: 'false'
|
type: choice
|
||||||
# versionTag:
|
options:
|
||||||
# description: 'The version to tag with'
|
- 'true'
|
||||||
# required: true
|
- 'false'
|
||||||
|
tag_value:
|
||||||
|
description: 'Create a new release from latest master with the given tag, if this is left blank it will bump the patch version. You dont need to include the "v" prefix'
|
||||||
|
required: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
@ -42,6 +45,8 @@ jobs:
|
||||||
github_token: ${{ github.token }}
|
github_token: ${{ github.token }}
|
||||||
tag_prefix: v
|
tag_prefix: v
|
||||||
default_bump: patch
|
default_bump: patch
|
||||||
|
# if set, it will overwrite the bump settings
|
||||||
|
custom_tag: ${{ github.event.inputs.tag_value == '' && null || github.event.inputs.tag_value }}
|
||||||
|
|
||||||
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
|
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
|
||||||
# with PRs -- not commits (determine how much we care).
|
# with PRs -- not commits (determine how much we care).
|
||||||
|
@ -62,9 +67,18 @@ jobs:
|
||||||
node index.js
|
node index.js
|
||||||
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
||||||
|
|
||||||
- name: Create a GitHub Release
|
- name: Create a GitHub Release (Manual)
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: steps.tag_version.outputs.new_tag
|
if: steps.tag_version.outputs.new_tag && github.event_name == 'workflow_dispatch'
|
||||||
|
with:
|
||||||
|
body_path: ./release-notes.md
|
||||||
|
draft: true
|
||||||
|
prerelease: ${{ github.event_name != 'workflow_dispatch' || inputs.is_prelease == 'true' }}
|
||||||
|
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
|
||||||
|
- name: Create a GitHub Release (Push)
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: steps.tag_version.outputs.new_tag && github.event_name != 'workflow_dispatch'
|
||||||
with:
|
with:
|
||||||
body_path: ./release-notes.md
|
body_path: ./release-notes.md
|
||||||
draft: true
|
draft: true
|
||||||
|
@ -86,6 +100,7 @@ jobs:
|
||||||
cmakeflags: ""
|
cmakeflags: ""
|
||||||
buildAppImage: true
|
buildAppImage: true
|
||||||
fetchTags: true
|
fetchTags: true
|
||||||
|
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
build_linux_flatpak:
|
build_linux_flatpak:
|
||||||
|
@ -102,6 +117,7 @@ jobs:
|
||||||
branch: "stable"
|
branch: "stable"
|
||||||
publish: false
|
publish: false
|
||||||
fetchTags: true
|
fetchTags: true
|
||||||
|
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
|
@ -118,6 +134,7 @@ jobs:
|
||||||
buildSystem: cmake
|
buildSystem: cmake
|
||||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||||
fetchTags: true
|
fetchTags: true
|
||||||
|
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# MacOS
|
# MacOS
|
||||||
|
@ -131,6 +148,7 @@ jobs:
|
||||||
jobName: "MacOS Build"
|
jobName: "MacOS Build"
|
||||||
artifactPrefixName: "PCSX2-macos-Qt"
|
artifactPrefixName: "PCSX2-macos-Qt"
|
||||||
fetchTags: true
|
fetchTags: true
|
||||||
|
stableBuild: ${{ github.event_name == 'workflow_dispatch' && inputs.is_prelease == 'false' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# Upload the Artifacts
|
# Upload the Artifacts
|
||||||
|
@ -163,9 +181,6 @@ jobs:
|
||||||
working-directory: ./ci-artifacts/
|
working-directory: ./ci-artifacts/
|
||||||
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
|
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
|
||||||
|
|
||||||
# Artifact Naming:
|
|
||||||
# MacOS: PCSX2-<tag>-macOS-[additional hyphen seperated tags]
|
|
||||||
# Windows|Linux: PCSX2-<tag>-<windows|linux>-<32bit|64bit>--[additional hyphen seperated tags]
|
|
||||||
- name: Name and Upload the Release Assets
|
- name: Name and Upload the Release Assets
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
|
@ -40,6 +40,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
stableBuild:
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_windows_qt:
|
build_windows_qt:
|
||||||
|
@ -61,6 +65,13 @@ jobs:
|
||||||
if: ${{ inputs.fetchTags }}
|
if: ${{ inputs.fetchTags }}
|
||||||
run: git fetch --tags --no-recurse-submodules
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
- name: Add stable release identifier file
|
||||||
|
if: ${{ inputs.stableBuild == true || inputs.stableBuild == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "#define DEFAULT_UPDATER_CHANNEL \"stable\"" > ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
cat ./pcsx2-qt/DefaultUpdaterChannel.h
|
||||||
|
|
||||||
- name: Prepare Artifact Metadata
|
- name: Prepare Artifact Metadata
|
||||||
id: artifact-metadata
|
id: artifact-metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -56,11 +56,24 @@ function(get_git_version_info)
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
ERROR_QUIET)
|
ERROR_QUIET)
|
||||||
|
|
||||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD --sort=version:refname
|
||||||
OUTPUT_VARIABLE PCSX2_GIT_TAG
|
OUTPUT_VARIABLE PCSX2_GIT_TAG_LIST
|
||||||
|
RESULT_VARIABLE TAG_RESULT
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
ERROR_QUIET)
|
ERROR_QUIET)
|
||||||
|
|
||||||
|
# CAUTION: There is a race here, this solves the problem of a commit being tagged multiple times (take the last tag)
|
||||||
|
# however, if simultaneous builds are pushing tags to the same commit you might get inconsistent results (it's a race)
|
||||||
|
#
|
||||||
|
# The easy solution is, don't do that, but just something to be aware of.
|
||||||
|
if(PCSX2_GIT_TAG_LIST AND TAG_RESULT EQUAL 0)
|
||||||
|
string(REPLACE "\n" ";" PCSX2_GIT_TAG_LIST "${PCSX2_GIT_TAG_LIST}")
|
||||||
|
if (PCSX2_GIT_TAG_LIST)
|
||||||
|
list(GET PCSX2_GIT_TAG_LIST -1 PCSX2_GIT_TAG)
|
||||||
|
message("Using tag: ${PCSX2_GIT_TAG}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||||
OUTPUT_VARIABLE PCSX2_GIT_HASH
|
OUTPUT_VARIABLE PCSX2_GIT_HASH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
|
Loading…
Reference in New Issue