[CI] Allow publish from specified commitish

This commit is contained in:
halx99 2024-10-22 13:04:10 +08:00
parent 425c34bbb5
commit 8a705f1dcb
2 changed files with 12 additions and 2 deletions

View File

@ -14,6 +14,10 @@ on:
default: 'auto' default: 'auto'
# Input has to be provided for the workflow to run # Input has to be provided for the workflow to run
required: false required: false
commitish:
description: 'Please input commitis value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch.'
default: 'dev'
required: false
jobs: jobs:
publish: publish:
runs-on: windows-latest runs-on: windows-latest
@ -62,7 +66,7 @@ jobs:
./setup.ps1 ./setup.ps1
./1k/fetch.ps1 -uri 'oboe' -prefix $(Join-Path $AX_ROOT 'cache') -manifest $(Join-Path $AX_ROOT 'manifest.json') ./1k/fetch.ps1 -uri 'oboe' -prefix $(Join-Path $AX_ROOT 'cache') -manifest $(Join-Path $AX_ROOT 'manifest.json')
axmol -xc '-DAX_WITH_LZ4=ON,-DAX_WITH_CARES=ON,-DAX_WITH_YAML_CPP=ON,-DAX_WITH_KCP=ON' -c axmol -xc '-DAX_WITH_LZ4=ON,-DAX_WITH_CARES=ON,-DAX_WITH_YAML_CPP=ON,-DAX_WITH_KCP=ON' -c
./tools/ci/publish.ps1 -version "${{ steps.forward_ver.outputs.release_ver }}" ./tools/ci/publish.ps1 -version "${{ steps.forward_ver.outputs.release_ver }}" -commitish "${{ github.event.inputs.commitish }}"
- name: Publish to github release page - name: Publish to github release page
if: ${{ steps.make_pkg.outputs.release_tag != '' }} if: ${{ steps.make_pkg.outputs.release_tag != '' }}
@ -73,5 +77,6 @@ jobs:
files: ${{ steps.make_pkg.outputs.release_pkg }} files: ${{ steps.make_pkg.outputs.release_pkg }}
body_path: ${{ steps.make_pkg.outputs.release_note }} body_path: ${{ steps.make_pkg.outputs.release_note }}
prerelease: ${{ steps.make_pkg.outputs.prerelease }} prerelease: ${{ steps.make_pkg.outputs.prerelease }}
target_commitish: ${{ github.event.inputs.commitish }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,8 +1,13 @@
param( param(
$version = $null $version = $null,
$commitish = $null
) )
$AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path $AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path
if ($commitish) {
echo "Creating package from revision: $commitish"
git -C $AX_ROOT checkout $commitish
}
$prerelease = 'false' $prerelease = 'false'
if (!$version -or ($version -eq 'auto')) { if (!$version -or ($version -eq 'auto')) {