Skip to content

Commit

Permalink
fix: release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
uyriq authored Oct 27, 2024
1 parent 7630a32 commit 1aba464
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
$tagsArray = $tags -split "`n"
# Get the second latest tag
$prevTag = if ($tagsArray.Length -ge 2) { $tagsArray[1].Trim() } else { "" }
if (-not $prevTag) {
# No previous tag found, fallback to the last commit hash
$prevTag = git log -1 --pretty=format:"%H"
}
# Write previous tag to environment file
Write-Host "Previous tag: $prevTag"
echo "PREV_TAG=$prevTag" >> $env:GITHUB_ENV
Expand Down Expand Up @@ -68,7 +74,7 @@ jobs:
asset_name: mytotp.rc.ps1
asset_content_type: text/plain

- name: Upload .rc Bash script
- name: Upload Bash script
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
Expand All @@ -78,16 +84,6 @@ jobs:
asset_name: mytotp.rc
asset_content_type: text/plain

- name: Upload standalone Bash script
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mytotp.sh
asset_name: mytotp.sh
asset_content_type: text/plain

- name: Upload README.md
uses: actions/upload-release-asset@v1
env:
Expand Down

0 comments on commit 1aba464

Please sign in to comment.