mirror of https://github.com/PCSX2/pcsx2.git
ci: one workflow to fix caching issue and simplify releases
This commit is contained in:
parent
8fad768d39
commit
822b166753
|
@ -47,8 +47,8 @@ jobs:
|
||||||
|
|
||||||
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
|
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
|
||||||
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
|
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
|
||||||
|
# actions/checkout elides tags, fetch them primarily for releases
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
if: inputs.publish == true
|
|
||||||
id: fetch-tags
|
id: fetch-tags
|
||||||
run: git fetch --tags --no-recurse-submodules
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
# actions/checkout elides tags, fetch them primarily for releases
|
||||||
|
- name: Fetch Tags
|
||||||
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
- name: Prepare Artifact Metadata
|
- name: Prepare Artifact Metadata
|
||||||
id: artifact-metadata
|
id: artifact-metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -35,6 +35,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
# actions/checkout elides tags, fetch them primarily for releases
|
||||||
|
- name: Fetch Tags
|
||||||
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,181 @@
|
||||||
|
# Whenever a commit is pushed to master (ideally via a pull-request!)
|
||||||
|
# this action will create the next release, which means:
|
||||||
|
# 1. tag master with the proper version
|
||||||
|
# 2. create a new draft release (pre-released if a nightly build)
|
||||||
|
# 3. add release notes
|
||||||
|
|
||||||
|
name: 🏭 Create Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
# TODO - future work
|
||||||
|
# workflow_dispatch:
|
||||||
|
# inputs:
|
||||||
|
# isStable:
|
||||||
|
# description: 'Should it be a stable release?'
|
||||||
|
# required: true
|
||||||
|
# default: 'false'
|
||||||
|
# versionTag:
|
||||||
|
# description: 'The version to tag with'
|
||||||
|
# required: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cut-release:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "Create Tag and Release"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Docs - https://github.com/mathieudutour/github-tag-action
|
||||||
|
- name: Bump Version and Push Tag
|
||||||
|
id: tag_version
|
||||||
|
uses: mathieudutour/github-tag-action@v6.1
|
||||||
|
with:
|
||||||
|
github_token: ${{ github.token }}
|
||||||
|
tag_prefix: v
|
||||||
|
default_bump: patch
|
||||||
|
|
||||||
|
# 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).
|
||||||
|
# - name: Create Draft Release
|
||||||
|
# run: |
|
||||||
|
# echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}"
|
||||||
|
# gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
|
||||||
|
- name: Generate Release Notes
|
||||||
|
env:
|
||||||
|
OWNER: PCSX2
|
||||||
|
REPO: pcsx2
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
COMMIT_SHA: ${{ github.SHA }}
|
||||||
|
run: |
|
||||||
|
cd ./.github/workflows/scripts/releases/generate-release-notes
|
||||||
|
npm ci
|
||||||
|
node index.js
|
||||||
|
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
||||||
|
|
||||||
|
- name: Create a GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: steps.tag_version.outputs.new_tag
|
||||||
|
with:
|
||||||
|
body_path: ./release-notes.md
|
||||||
|
draft: true
|
||||||
|
prerelease: true
|
||||||
|
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
# Build Everything
|
||||||
|
# Linux
|
||||||
|
build_linux_qt:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
needs:
|
||||||
|
- cut-release
|
||||||
|
name: "Linux"
|
||||||
|
uses: ./.github/workflows/linux_build_qt.yml
|
||||||
|
with:
|
||||||
|
jobName: "AppImage Build"
|
||||||
|
compiler: clang
|
||||||
|
cmakeflags: ""
|
||||||
|
buildAppImage: true
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
build_linux_flatpak:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
needs:
|
||||||
|
- cut-release
|
||||||
|
name: "Linux"
|
||||||
|
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||||
|
with:
|
||||||
|
jobName: "Flatpak Build"
|
||||||
|
compiler: clang
|
||||||
|
cmakeflags: ""
|
||||||
|
branch: "stable"
|
||||||
|
publish: false
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
build_windows_qt:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
needs:
|
||||||
|
- cut-release
|
||||||
|
name: "Windows"
|
||||||
|
uses: ./.github/workflows/windows_build_qt.yml
|
||||||
|
with:
|
||||||
|
jobName: "Windows Build"
|
||||||
|
configuration: CMake
|
||||||
|
buildSystem: cmake
|
||||||
|
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# MacOS
|
||||||
|
build_macos_qt:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
needs:
|
||||||
|
- cut-release
|
||||||
|
name: "MacOS"
|
||||||
|
uses: ./.github/workflows/macos_build.yml
|
||||||
|
with:
|
||||||
|
jobName: "MacOS Build"
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Upload the Artifacts
|
||||||
|
upload_artifacts:
|
||||||
|
if: github.repository == 'PCSX2/pcsx2'
|
||||||
|
needs:
|
||||||
|
- build_linux_flatpak
|
||||||
|
- build_linux_qt
|
||||||
|
- build_windows_qt
|
||||||
|
- build_macos_qt
|
||||||
|
name: "Upload Artifacts"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# actions/checkout elides tags, fetch them primarily for releases
|
||||||
|
- name: Fetch Tags
|
||||||
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
|
- name: Prepare Artifact Folder
|
||||||
|
run: mkdir ./ci-artifacts/
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
name: Download all Artifacts
|
||||||
|
with:
|
||||||
|
path: ./ci-artifacts/
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls ./ci-artifacts/
|
||||||
|
|
||||||
|
# Prepare artifacts, they are all zips from github!
|
||||||
|
- name: Prepare Artifacts
|
||||||
|
working-directory: ./ci-artifacts/
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
||||||
|
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||||
|
run: |
|
||||||
|
TAG_VAL=$(git tag --points-at HEAD)
|
||||||
|
echo "TAG_VAL=${TAG_VAL}"
|
||||||
|
gh release list --repo PCSX2/pcsx2
|
||||||
|
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||||
|
TAG_VAL=${TAG_VAL} python ./.github/workflows/scripts/releases/rename-release-assets.py
|
||||||
|
ls ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||||
|
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/out/* --repo PCSX2/pcsx2 --clobber
|
||||||
|
|
||||||
|
- name: Publish Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
TAG_VAL=$(git tag --points-at HEAD)
|
||||||
|
echo "TAG_VAL=${TAG_VAL}"
|
||||||
|
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2
|
|
@ -1,71 +0,0 @@
|
||||||
# Whenever a commit is pushed to master (ideally via a pull-request!)
|
|
||||||
# this action will create the next release, which means:
|
|
||||||
# 1. tag master with the proper version
|
|
||||||
# 2. create a new draft release (pre-released if a nightly build)
|
|
||||||
# 3. add release notes
|
|
||||||
|
|
||||||
name: 🏭 Create Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
# TODO - future work
|
|
||||||
# workflow_dispatch:
|
|
||||||
# inputs:
|
|
||||||
# isStable:
|
|
||||||
# description: 'Should it be a stable release?'
|
|
||||||
# required: true
|
|
||||||
# default: 'false'
|
|
||||||
# versionTag:
|
|
||||||
# description: 'The version to tag with'
|
|
||||||
# required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cut-release:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: "Create Tag and Release"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Docs - https://github.com/mathieudutour/github-tag-action
|
|
||||||
- name: Bump Version and Push Tag
|
|
||||||
id: tag_version
|
|
||||||
uses: mathieudutour/github-tag-action@v6.1
|
|
||||||
with:
|
|
||||||
# Workflows cannot trigger other workflows implicitly
|
|
||||||
# - https://github.community/t/github-actions-workflow-not-triggering-with-tag-push/17053/7
|
|
||||||
github_token: ${{ secrets.BOT_PAT }}
|
|
||||||
tag_prefix: v
|
|
||||||
default_bump: patch
|
|
||||||
|
|
||||||
# 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).
|
|
||||||
# - name: Create Draft Release
|
|
||||||
# env:
|
|
||||||
# GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
|
||||||
# run: |
|
|
||||||
# echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}"
|
|
||||||
# gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }}
|
|
||||||
|
|
||||||
- name: Generate Release Notes
|
|
||||||
env:
|
|
||||||
OWNER: PCSX2
|
|
||||||
REPO: pcsx2
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
COMMIT_SHA: ${{ github.SHA }}
|
|
||||||
run: |
|
|
||||||
cd ./.github/workflows/scripts/releases/generate-release-notes
|
|
||||||
npm ci
|
|
||||||
node index.js
|
|
||||||
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
|
||||||
|
|
||||||
- name: Create a GitHub Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: steps.tag_version.outputs.new_tag
|
|
||||||
with:
|
|
||||||
body_path: ./release-notes.md
|
|
||||||
draft: true
|
|
||||||
prerelease: true
|
|
||||||
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
|
|
@ -1,106 +0,0 @@
|
||||||
name: 🏭 Release Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Build Everything
|
|
||||||
# Linux
|
|
||||||
build_linux_qt:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
name: "Linux"
|
|
||||||
uses: ./.github/workflows/linux_build_qt.yml
|
|
||||||
with:
|
|
||||||
jobName: "AppImage Build"
|
|
||||||
compiler: clang
|
|
||||||
cmakeflags: ""
|
|
||||||
buildAppImage: true
|
|
||||||
secrets: inherit
|
|
||||||
build_linux_flatpak:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
name: "Linux"
|
|
||||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
|
||||||
with:
|
|
||||||
jobName: "Flatpak Build"
|
|
||||||
compiler: clang
|
|
||||||
cmakeflags: ""
|
|
||||||
branch: "stable"
|
|
||||||
publish: false
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
build_windows_qt:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
name: "Windows"
|
|
||||||
uses: ./.github/workflows/windows_build_qt.yml
|
|
||||||
with:
|
|
||||||
jobName: "Windows Build"
|
|
||||||
configuration: CMake
|
|
||||||
buildSystem: cmake
|
|
||||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
# MacOS
|
|
||||||
build_macos_qt:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
name: "MacOS"
|
|
||||||
uses: ./.github/workflows/macos_build.yml
|
|
||||||
with:
|
|
||||||
jobName: "MacOS Build"
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
# Upload the Artifacts
|
|
||||||
upload_artifacts:
|
|
||||||
if: github.repository == 'PCSX2/pcsx2'
|
|
||||||
needs:
|
|
||||||
- build_linux_flatpak
|
|
||||||
- build_linux_qt
|
|
||||||
- build_windows_qt
|
|
||||||
- build_macos_qt
|
|
||||||
name: "Upload Artifacts"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare Artifact Folder
|
|
||||||
run: mkdir ./ci-artifacts/
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
name: Download all Artifacts
|
|
||||||
with:
|
|
||||||
path: ./ci-artifacts/
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls ./ci-artifacts/
|
|
||||||
|
|
||||||
# Prepare artifacts, they are all zips from github!
|
|
||||||
- name: Prepare Artifacts
|
|
||||||
working-directory: ./ci-artifacts/
|
|
||||||
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
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
TAG: ${{ github.REF }}
|
|
||||||
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
|
||||||
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
|
|
||||||
run: |
|
|
||||||
gh release list --repo PCSX2/pcsx2
|
|
||||||
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
|
|
||||||
python ./.github/workflows/scripts/releases/rename-release-assets.py
|
|
||||||
ls ${{ github.WORKSPACE }}/ci-artifacts/out
|
|
||||||
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
|
|
||||||
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/out/* --repo PCSX2/pcsx2 --clobber
|
|
||||||
|
|
||||||
- name: Publish Release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
|
||||||
run: |
|
|
||||||
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
|
|
||||||
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
tag = os.environ['TAG'].split("refs/tags/")[1]
|
tag = os.environ['TAG_VAL']
|
||||||
scan_dir = os.environ['SCAN_DIR']
|
scan_dir = os.environ['SCAN_DIR']
|
||||||
output_dir = os.environ['OUT_DIR']
|
output_dir = os.environ['OUT_DIR']
|
||||||
accepted_exts = ["AppImage", "flatpak", "tar.xz", "7z"]
|
accepted_exts = ["AppImage", "flatpak", "tar.xz", "7z"]
|
||||||
|
|
|
@ -57,6 +57,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
# actions/checkout elides tags, fetch them primarily for releases
|
||||||
|
- name: Fetch Tags
|
||||||
|
run: git fetch --tags --no-recurse-submodules
|
||||||
|
|
||||||
- name: Prepare Artifact Metadata
|
- name: Prepare Artifact Metadata
|
||||||
id: artifact-metadata
|
id: artifact-metadata
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
Loading…
Reference in New Issue