From 8a705f1dcb001c2312da8e54bdf70c50c9cfccff Mon Sep 17 00:00:00 2001 From: halx99 Date: Tue, 22 Oct 2024 13:04:10 +0800 Subject: [PATCH] [CI] Allow publish from specified commitish --- .github/workflows/publish.yml | 7 ++++++- tools/ci/publish.ps1 | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42bb51e3ff..cb104618bc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,10 @@ on: default: 'auto' # Input has to be provided for the workflow to run 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: publish: runs-on: windows-latest @@ -62,7 +66,7 @@ jobs: ./setup.ps1 ./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 - ./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 if: ${{ steps.make_pkg.outputs.release_tag != '' }} @@ -73,5 +77,6 @@ jobs: files: ${{ steps.make_pkg.outputs.release_pkg }} body_path: ${{ steps.make_pkg.outputs.release_note }} prerelease: ${{ steps.make_pkg.outputs.prerelease }} + target_commitish: ${{ github.event.inputs.commitish }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tools/ci/publish.ps1 b/tools/ci/publish.ps1 index fb95b6c783..cc598ef06d 100644 --- a/tools/ci/publish.ps1 +++ b/tools/ci/publish.ps1 @@ -1,8 +1,13 @@ param( - $version = $null + $version = $null, + $commitish = $null ) $AX_ROOT = (Resolve-Path $PSScriptRoot/../..).Path +if ($commitish) { + echo "Creating package from revision: $commitish" + git -C $AX_ROOT checkout $commitish +} $prerelease = 'false' if (!$version -or ($version -eq 'auto')) {