Workflow: Fix windows get release tag
This commit is contained in:
@@ -62,20 +62,37 @@ jobs:
|
||||
|
||||
ditto -c -k --keepParent "$APP_PATH" "$APP_NAME-macos.zip"
|
||||
|
||||
# --- Determine tag ---
|
||||
- name: Get release tag
|
||||
# --- Get release Tag ---
|
||||
- name: Get release tag (Unix)
|
||||
if: matrix.os != 'windows-latest'
|
||||
id: get_tag
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
|
||||
elif [ -n "${{ inputs.tag }}" ]; then
|
||||
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
# fallback: latest tag
|
||||
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Get release tag (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
id: get_tag
|
||||
shell: pwsh
|
||||
run: |
|
||||
if ("${{ github.event_name }}" -eq "release") {
|
||||
"tag=${{ github.event.release.tag_name }}" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
|
||||
}
|
||||
elseif ("${{ inputs.tag }}" -ne "") {
|
||||
"tag=${{ inputs.tag }}" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
|
||||
}
|
||||
else {
|
||||
$TAG = git describe --tags (git rev-list --tags --max-count=1)
|
||||
"tag=$TAG" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
# --- Upload to release ---
|
||||
- name: Upload to GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
Reference in New Issue
Block a user