mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[CI] Move releases to separate repository
This commit is contained in:
parent
dbe645e16e
commit
b7b6b860a9
59
.github/workflows/Create_release.yml
vendored
Normal file
59
.github/workflows/Create_release.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
name: Create release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
RELEASE_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@main
|
||||||
|
- name: Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
GH_REPO: ${{ github.repository_owner }}/xenia-canary-releases
|
||||||
|
notes: ${{ github.event.head_commit.message }}
|
||||||
|
run: |
|
||||||
|
rm -rf **/*.pdb
|
||||||
|
case ${{ inputs.os }} in
|
||||||
|
windows)
|
||||||
|
asset=xenia_canary_windows.zip
|
||||||
|
7z a $asset './xenia_canary_windows/*'
|
||||||
|
;;
|
||||||
|
linux)
|
||||||
|
asset=xenia_canary_linux.tar.gz
|
||||||
|
cd xenia_canary_linux
|
||||||
|
chmod +x xenia_canary
|
||||||
|
tar -cvpf ../$asset *
|
||||||
|
cd -
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ ! -f $asset ]; then
|
||||||
|
echo "::error::$asset doesn't exist!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ $(stat -c%s $asset) -lt 100000 ]; then
|
||||||
|
echo "::error::$asset is too small!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
create_or_edit_release() {
|
||||||
|
local tag=$1
|
||||||
|
local title=$2
|
||||||
|
if gh release view $tag; then
|
||||||
|
gh release edit $tag -n "$notes"
|
||||||
|
gh release upload $tag $asset --clobber
|
||||||
|
else
|
||||||
|
gh release create $tag $asset --target 925ed98d5dce604b651027c36fb522dc1ff0fa55 -t $title -n "$notes"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
tag=${GITHUB_SHA::7}
|
||||||
|
create_or_edit_release $tag ${tag}_$GITHUB_REF_NAME
|
||||||
|
create_or_edit_release $GITHUB_REF_NAME $tag
|
||||||
14
.github/workflows/Linux_build.yml
vendored
14
.github/workflows/Linux_build.yml
vendored
|
|
@ -89,9 +89,21 @@ jobs:
|
||||||
cp -r build/bin/Linux/Release/xenia_canary LICENSE artifacts
|
cp -r build/bin/Linux/Release/xenia_canary LICENSE artifacts
|
||||||
- name: Upload xenia canary artifacts
|
- name: Upload xenia canary artifacts
|
||||||
if: steps.prepare_artifacts.outcome == 'success'
|
if: steps.prepare_artifacts.outcome == 'success'
|
||||||
id: upload_artifacts
|
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: xenia_canary_linux
|
name: xenia_canary_linux
|
||||||
path: artifacts
|
path: artifacts
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
name: Create release
|
||||||
|
needs: [lint, build]
|
||||||
|
if: |
|
||||||
|
github.repository == 'xenia-canary/xenia-canary' &&
|
||||||
|
github.event.action != 'pull_request' &&
|
||||||
|
github.ref == 'refs/heads/canary_experimental'
|
||||||
|
uses: ./.github/workflows/Create_release.yml
|
||||||
|
with:
|
||||||
|
os: linux
|
||||||
|
secrets:
|
||||||
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
|
|
||||||
39
.github/workflows/Windows_build.yml
vendored
39
.github/workflows/Windows_build.yml
vendored
|
|
@ -80,34 +80,21 @@ jobs:
|
||||||
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
|
If ($LastExitCode -le 7) { echo "LastExitCode = $LastExitCode";$LastExitCode = 0 }
|
||||||
- name: Upload xenia canary artifacts
|
- name: Upload xenia canary artifacts
|
||||||
if: steps.prepare_artifacts.outcome == 'success'
|
if: steps.prepare_artifacts.outcome == 'success'
|
||||||
id: upload_artifacts
|
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: xenia_canary_windows
|
name: xenia_canary_windows
|
||||||
path: artifacts\xenia_canary
|
path: artifacts\xenia_canary
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
- name: Create release
|
|
||||||
if: |
|
create-release:
|
||||||
github.repository == 'xenia-canary/xenia-canary' &&
|
name: Create release
|
||||||
github.event.action != 'pull_request' &&
|
needs: [lint, build]
|
||||||
github.ref == 'refs/heads/canary_experimental' &&
|
if: |
|
||||||
steps.upload_artifacts.outcome == 'success'
|
github.repository == 'xenia-canary/xenia-canary' &&
|
||||||
env:
|
github.event.action != 'pull_request' &&
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
github.ref == 'refs/heads/canary_experimental'
|
||||||
run: |
|
uses: ./.github/workflows/Create_release.yml
|
||||||
$asset="xenia_canary.zip"
|
with:
|
||||||
rm -recurse -force artifacts\xenia_canary\*.pdb # Ideally this would use xr, but I can't get it to work
|
os: windows
|
||||||
7z a $asset .\artifacts\xenia_canary\*
|
secrets:
|
||||||
If ($(Get-Item $asset).length -le 100000) {
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
Throw "Error: Archive $asset too small!"
|
|
||||||
}
|
|
||||||
$tag=$env:GITHUB_SHA.SubString(0,7)
|
|
||||||
$branch=$($env:GITHUB_REF -replace 'refs/heads/')
|
|
||||||
$title="${tag}_$branch"
|
|
||||||
gh release create $tag $asset --target $env:GITHUB_SHA -t $title
|
|
||||||
# Remove canary_ to prevent conflicts from tag
|
|
||||||
$tag=$($branch -replace 'canary_')
|
|
||||||
gh release delete $tag -y
|
|
||||||
git push --delete origin $tag
|
|
||||||
git tag -d $tag
|
|
||||||
gh release create $tag $asset --target $env:GITHUB_SHA -t $branch
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Discussing illegal activities will get you banned.
|
||||||
|
|
||||||
Buildbot | Status | Releases
|
Buildbot | Status | Releases
|
||||||
-------- | ------ | --------
|
-------- | ------ | --------
|
||||||
Windows | [](https://github.com/xenia-canary/xenia-canary/actions/workflows/Windows_build.yml) [](https://app.codacy.com/gh/xenia-canary/xenia-canary/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) | [Latest](https://github.com/xenia-canary/xenia-canary/releases/latest) ◦ [All](https://github.com/xenia-canary/xenia-canary/releases)
|
Windows | [](https://github.com/xenia-canary/xenia-canary/actions/workflows/Windows_build.yml) [](https://app.codacy.com/gh/xenia-canary/xenia-canary/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) | [Latest](https://github.com/xenia-canary/xenia-canary-releases/releases/tag/canary_experimental_ci) ◦ [All](https://github.com/xenia-canary/xenia-canary-releases/releases) ◦ [Old](https://github.com/xenia-canary/xenia-canary/releases)
|
||||||
Linux | [](https://github.com/xenia-canary/xenia-canary/actions/workflows/Linux_build.yml)
|
Linux | [](https://github.com/xenia-canary/xenia-canary/actions/workflows/Linux_build.yml)
|
||||||
Netplay Build | | [Latest](https://github.com/AdrianCassar/xenia-canary/releases/latest)
|
Netplay Build | | [Latest](https://github.com/AdrianCassar/xenia-canary/releases/latest)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue