Allow paths as inputs
This commit is contained in:
parent
790467d3b1
commit
1094e73c1c
@ -2,7 +2,19 @@ name: Unreal Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
windows_build_path:
|
||||||
|
description: 'Absolute path to the Windows build zip file'
|
||||||
|
required: true
|
||||||
|
default: 'E:\LuckyWorld\LuckyRobots\UNREAL_PROJECTS\Luckyrobots\Builds\Windows\LuckyRobots-Windows.zip'
|
||||||
|
linux_build_path:
|
||||||
|
description: 'Absolute path to the Linux build zip file'
|
||||||
|
required: true
|
||||||
|
default: 'E:\LuckyWorld\LuckyRobots\UNREAL_PROJECTS\Luckyrobots\Builds\Linux\LuckyRobots-Linux.zip'
|
||||||
|
mac_build_path:
|
||||||
|
description: 'Absolute path to the Mac build zip file'
|
||||||
|
required: true
|
||||||
|
default: 'E:\LuckyWorld\LuckyRobots\UNREAL_PROJECTS\Luckyrobots\Builds\Mac\LuckyRobots-Mac.zip'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -12,56 +24,74 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: LuckyRobots-Linux
|
name: LuckyRobots-Linux
|
||||||
path: E:\LuckyWorld\LuckyRobots\UNREAL_PROJECTS\Luckyrobots\Builds\Linux\LuckyRobots-Linux.zip
|
path: ${{ github.event.inputs.linux_build_path }}
|
||||||
retention-days: 14
|
retention-days: 365
|
||||||
|
|
||||||
- name: Upload Windows Build Artifact
|
- name: Upload Windows Build Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: LuckyRobots-Windows
|
name: LuckyRobots-Windows
|
||||||
path: E:\LuckyWorld\LuckyRobots\UNREAL_PROJECTS\Luckyrobots\Builds\Windows\LuckyRobots-Windows.zip
|
path: ${{ github.event.inputs.windows_build_path }}
|
||||||
retention-days: 14
|
retention-days: 365
|
||||||
|
|
||||||
|
- name: Upload Mac Build Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: LuckyRobots-Mac
|
||||||
|
path: ${{ github.event.inputs.mac_build_path }}
|
||||||
|
retention-days: 365
|
||||||
|
|
||||||
- name: Get Release Tag
|
- name: Get Release Tag
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
# Fetch all tags
|
# Fetch all tags
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
|
|
||||||
# Get the latest version tag
|
# Get the latest version tag, if any
|
||||||
LATEST_TAG=$(git tag -l "v[0-9]*.[0-9]*.[0-9]*" | sort -V | tail -n1)
|
# Uses Sort-Object with a version comparison scriptblock
|
||||||
|
$latestTag = git tag -l "v[0-9]*.[0-9]*.[0-9]*" | Sort-Object -Property @{Expression={[version]($_ -replace 'v')}} | Select-Object -Last 1
|
||||||
|
|
||||||
if [ -z "$LATEST_TAG" ]; then
|
$newVersion = "1.0.0" # Default start version
|
||||||
NEW_VERSION="1.0.0"
|
|
||||||
else
|
|
||||||
VERSION=${LATEST_TAG#v}
|
|
||||||
MAJOR=$(echo $VERSION | cut -d. -f1)
|
|
||||||
MINOR=$(echo $VERSION | cut -d. -f2)
|
|
||||||
PATCH=$(echo $VERSION | cut -d. -f3)
|
|
||||||
PATCH=$((PATCH + 1))
|
|
||||||
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
TAG="v${NEW_VERSION}"
|
if ($null -ne $latestTag -and $latestTag -ne '') {
|
||||||
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV
|
Write-Host "Latest tag found: $latestTag"
|
||||||
echo "Using release tag: $TAG"
|
# Strip 'v' prefix
|
||||||
|
$versionString = $latestTag -replace '^v'
|
||||||
|
|
||||||
|
# Split version into parts
|
||||||
|
$versionParts = $versionString.Split('.')
|
||||||
|
if ($versionParts.Length -eq 3) {
|
||||||
|
$major = [int]$versionParts[0]
|
||||||
|
$minor = [int]$versionParts[1]
|
||||||
|
$patch = [int]$versionParts[2]
|
||||||
|
|
||||||
|
# Auto-increment patch version
|
||||||
|
$patch++
|
||||||
|
$newVersion = "$major.$minor.$patch"
|
||||||
|
Write-Host "Auto-incremented patch version from $versionString to $newVersion"
|
||||||
|
} else {
|
||||||
|
Write-Host "Could not parse version from tag: $latestTag. Defaulting to 1.0.0"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "No previous version tags found, starting with 1.0.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Final tag with v prefix
|
||||||
|
$tag = "v$newVersion"
|
||||||
|
|
||||||
|
# Set environment variable for subsequent steps
|
||||||
|
echo "RELEASE_TAG=$tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
Write-Host "Using release tag: $tag"
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: https://gitea.com/actions/gitea-release-action@main
|
uses: https://gitea.com/actions/gitea-release-action@main
|
||||||
with:
|
with:
|
||||||
files: |-
|
|
||||||
PackagedReleases/build-info.json
|
|
||||||
PackagedReleases/downloads.html
|
|
||||||
token: '${{ secrets.GITEA_TOKEN }}'
|
token: '${{ secrets.GITEA_TOKEN }}'
|
||||||
title: 'Release ${{ env.RELEASE_TAG }}'
|
title: 'Release ${{ env.RELEASE_TAG }}'
|
||||||
body: |
|
body: |
|
||||||
## LuckyRobots Game Release ${{ env.RELEASE_TAG }}
|
## LuckyRobots Game Release ${{ env.RELEASE_TAG }}
|
||||||
|
|
||||||
### Download Links
|
Windows, Linux and Mac builds are attached below.
|
||||||
|
|
||||||
Download builds from our CI artifacts:
|
|
||||||
|
|
||||||
- [Windows Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Windows)
|
|
||||||
- [Linux Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Linux)
|
|
||||||
|
|
||||||
### Build Information
|
### Build Information
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: LuckyRobots-Windows
|
name: LuckyRobots-Windows
|
||||||
path: PackagedReleases/LuckyRobots-Windows.zip
|
path: PackagedReleases/LuckyRobots-Windows.zip
|
||||||
retention-days: 14
|
retention-days: 365
|
||||||
|
|
||||||
- name: Upload Linux Build Artifact
|
- name: Upload Linux Build Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@ -72,7 +72,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: LuckyRobots-Linux
|
name: LuckyRobots-Linux
|
||||||
path: PackagedReleases/LuckyRobots-Linux.zip
|
path: PackagedReleases/LuckyRobots-Linux.zip
|
||||||
retention-days: 14
|
retention-days: 365
|
||||||
|
|
||||||
- name: Create Tag
|
- name: Create Tag
|
||||||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
|
||||||
@ -321,7 +321,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: LuckyRobots-macOS
|
name: LuckyRobots-macOS
|
||||||
path: PackagedReleases/*-macOS.zip
|
path: PackagedReleases/*-macOS.zip
|
||||||
retention-days: 14
|
retention-days: 365
|
||||||
|
|
||||||
- name: Create Release Note
|
- name: Create Release Note
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user