From acdf9fdc3fe31f6e32aef6ad5b6d362262a456cd Mon Sep 17 00:00:00 2001 From: ImaterialC <105358849+ImaterialC@users.noreply.github.com> Date: Fri, 9 Dec 2022 20:31:35 +0700 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de32ca5f..af664056 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,17 @@ name: Create new release -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + name: + description: "Custom release name" + default: "" + required: false + type: string + version: + description: "Custom tag name" + default: "" + required: false + type: string defaults: run: shell: pwsh @@ -17,6 +29,20 @@ jobs: - name: Preparing run: | + $TodayDate = Get-Date -Format 'yyyyMMdd' + echo "TODAY_DATE=$TodayDate" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + if ( "${{ inputs.name }}" ) { + echo "RELEASE_NAME=${{ inputs.name }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + } + else { + echo "RELEASE_NAME=Pricone UI EN DMM v$(Get-Date -Format 'yyyy.MM.dd')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + } + if ( "${{ inputs.version }}" ) { + echo "RELEASE_TAG=${{ inputs.version }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + } + else { + echo "RELEASE_TAG=$TodayDate" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + } mkdir newrelease - name: Downloading core files @@ -51,10 +77,7 @@ jobs: - name: Generating version files run: | - $TodayDate = (Get-Date -Format "yyyy.MM.dd") - $TodayDate | Out-File -FilePath "newrelease/Version.txt" -Encoding utf8 -Append - echo "TODAY_DATE=$TodayDate" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - echo "RELEASE_VERSION=$(Get-Date -Format 'yyyyMMdd')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + "${{ env.TODAY_DATE }}" | Out-File -FilePath "newrelease/Version.txt" -Encoding utf8 - name: Generating changelog id: changelog @@ -77,8 +100,9 @@ jobs: - name: Publish Release uses: ncipollo/release-action@v1 with: + name: ${{ env.RELEASE_NAME }} body: ${{ steps.changelog.outputs.changes }} - tag: ${{ env.RELEASE_VERSION }} + tag: ${{ env.RELEASE_TAG }} artifacts: "./PriconneTL_${{ env.TODAY_DATE }}.zip"