Keep the artifact name consistent across releases (#22)

This commit is contained in:
Gervasio Marchand 2022-12-22 14:51:42 -08:00 committed by GitHub
parent 2c11b898ff
commit f97c4d8270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 7 deletions

15
.github/release.yml vendored Normal file
View File

@ -0,0 +1,15 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Release and GitHub Actions changes 🛠
labels:
- release-improvement
- github-actions
- title: Exciting New Features 🎉
labels:
- new-feature
- title: Other Changes
labels:
- "*"

View File

@ -15,9 +15,12 @@ jobs:
- name: Build artifact
shell: pwsh
run: |
mkdir output
$tag = '${{ github.event.ref }}'.Replace('refs/tags/', '')
$zipDirectory = "GetMoarFediverse-$($tag)"
mkdir $tag
mkdir artifact
$outputPath = Join-Path (Pwd) output
$outputPath = Join-Path (Pwd) $zipDirectory
$srcPath = Join-Path (Pwd) src
$uid = sh -c 'id -u'
@ -25,16 +28,15 @@ jobs:
docker run -v "$($outputPath):/var/output" -v "$($srcPath):/var/src" mcr.microsoft.com/dotnet/sdk:6.0.403-alpine3.16 ash -c "dotnet publish -r ${{ matrix.runtime }} --self-contained -p:PublishTrimmed=true -p:PublishSingleFile=true -c Release /var/src/GetMoarFediverse.csproj -o /var/output && chown -R $($uid):$($gid) /var/output"
$tag = '${{ github.event.ref }}'.Replace('refs/tags/', '')
Push-Location output
Push-Location $outputPath
chmod +r *
chmod +x GetMoarFediverse || true
Pop-Location
if ('${{ matrix.runtime }}'.StartsWith('win-')) {
Compress-Archive -Path * -DestinationPath "../artifact/GetMoarFediverse_$($tag)_${{ matrix.runtime }}.zip"
Compress-Archive -Path $zipDirectory -DestinationPath "artifact/GetMoarFediverse_${{ matrix.runtime }}.zip"
} else {
tar -czf ../artifact/GetMoarFediverse_$($tag)_${{ matrix.runtime }}.tgz *
tar -czf artifact/GetMoarFediverse_${{ matrix.runtime }}.tgz $zipDirectory
}
- uses: actions/upload-artifact@v3