name: Unreal Release on: 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: build: runs-on: windows steps: - name: Upload Linux Build Artifact uses: actions/upload-artifact@v3 with: name: LuckyRobots-Linux path: ${{ github.event.inputs.linux_build_path }} retention-days: 365 - name: Upload Windows Build Artifact uses: actions/upload-artifact@v3 with: name: LuckyRobots-Windows path: ${{ github.event.inputs.windows_build_path }} 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 shell: pwsh run: | # Fetch all tags git fetch --tags # Get the latest version tag, if any # 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 $newVersion = "1.0.0" # Default start version if ($null -ne $latestTag -and $latestTag -ne '') { Write-Host "Latest tag found: $latestTag" # 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 uses: https://gitea.com/actions/gitea-release-action@main with: token: '${{ secrets.GITEA_TOKEN }}' title: 'Release ${{ env.RELEASE_TAG }}' body: | ## LuckyRobots Game Release ${{ env.RELEASE_TAG }} Windows, Linux and Mac builds are attached below. ### Build Information - Build Number: #${{ github.run_number }} - Commit: ${{ github.sha }} - Branch: ${{ github.ref_name }} - Build Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC") prerelease: ${{ github.ref != 'refs/heads/main' }} tag_name: '${{ env.RELEASE_TAG }}'