@@ -16,25 +16,21 @@ jobs:
1616 - os : macos-latest
1717 format : macos-arm
1818 arch_label : macos-arm64
19- gradle_task : packageReleaseDistributionForCurrentOS
2019
2120 # macOS Intel (x64)
2221 - os : macos-15-intel
2322 format : macos-intel
2423 arch_label : macos-x64
25- gradle_task : packageReleaseDistributionForCurrentOS
2624
2725 # Windows
2826 - os : windows-latest
2927 format : windows
3028 arch_label : windows-x64
31- gradle_task : packageReleaseDistributionForCurrentOS
3229
3330 # Linux
3431 - os : ubuntu-latest
3532 format : linux
3633 arch_label : linux-amd64
37- gradle_task : packageReleaseDistributionForCurrentOS
3834
3935 steps :
4036 - name : Checkout code
@@ -50,37 +46,52 @@ jobs:
5046 if : runner.os != 'Windows'
5147 run : chmod +x gradlew
5248
49+ - name : Inject release props
50+ shell : bash
51+ env :
52+ SENTRY_DNS : ${{ secrets.SENTRY_DNS }}
53+ run : |
54+ VERSION=${GITHUB_REF_NAME#v}
55+ echo "is_release=true" > desktopApp/src/jvmMain/resources/props.properties
56+ echo "sentry_dns=$SENTRY_DNS" >> desktopApp/src/jvmMain/resources/props.properties
57+ echo "version=$VERSION" >> desktopApp/src/jvmMain/resources/props.properties
58+
5359 - name : Build native packages
54- run : ./gradlew ${{ matrix.gradle_task }} --stacktrace
60+ run : ./gradlew packageReleaseDistributionForCurrentOS --stacktrace
5561
62+ # macOS ARM
5663 - name : Rename macOS ARM DMG
5764 if : matrix.format == 'macos-arm'
5865 run : |
59- FILE=$(find composeApp/build/compose/binaries -name "*.dmg" -type f )
60- NEW="DevAnalyzer-${{ github.ref_name }}-macos-arm64.dmg"
61- mv "$FILE" "$(dirname "$FILE")/$NEW "
66+ FILE=$(find composeApp/build/compose/binaries -name "*.dmg")
67+ VERSION=${GITHUB_REF_NAME#v}
68+ mv "$FILE" "$(dirname "$FILE")/DevAnalyzer-$VERSION-macos-arm64.dmg "
6269
70+ # macOS Intel
6371 - name : Rename macOS Intel DMG
6472 if : matrix.format == 'macos-intel'
6573 run : |
66- FILE=$(find composeApp/build/compose/binaries -name "*.dmg" -type f )
67- NEW="DevAnalyzer-${{ github.ref_name }}-macos-x64.dmg"
68- mv "$FILE" "$(dirname "$FILE")/$NEW "
74+ FILE=$(find composeApp/build/compose/binaries -name "*.dmg")
75+ VERSION=${GITHUB_REF_NAME#v}
76+ mv "$FILE" "$(dirname "$FILE")/DevAnalyzer-$VERSION-macos-x64.dmg "
6977
78+ # Windows
7079 - name : Rename Windows MSI
7180 if : matrix.format == 'windows'
7281 shell : pwsh
7382 run : |
74- $file = Get-ChildItem -Recurse -Filter *.msi -Path "composeApp/build/compose/binaries" | Select-Object -First 1
75- $newName = "DevAnalyzer-${{ github.ref_name }}-windows-x64 .msi"
76- Rename-Item -Path $file.FullName -NewName $newName
83+ $version = $env:GITHUB_REF_NAME.Replace("v","")
84+ $file = Get-ChildItem -Recurse -Filter * .msi composeApp/build/compose/binaries | Select-Object -First 1
85+ Rename-Item $file.FullName "DevAnalyzer-$version-windows-x64.msi"
7786
87+ # Linux
7888 - name : Rename Linux DEB
7989 if : matrix.format == 'linux'
8090 run : |
81- FILE=$(find composeApp/build/compose/binaries -name "*.deb" -type f)
82- NEW="DevAnalyzer-${{ github.ref_name }}-linux-amd64.deb"
83- mv "$FILE" "$(dirname "$FILE")/$NEW"
91+ FILE=$(find composeApp/build/compose/binaries -name "*.deb")
92+ VERSION=${GITHUB_REF_NAME#v}
93+ mv "$FILE" "$(dirname "$FILE")/DevAnalyzer-$VERSION-linux-amd64.deb"
94+
8495
8596 # Upload renamed artifacts
8697 - name : Upload artifact
@@ -117,4 +128,4 @@ jobs:
117128 draft : true
118129 tag_name : ${{ github.ref_name }}
119130 env :
120- GITHUB_TOKEN : ${{ secrets .GITHUB_TOKEN }}
131+ GITHUB_TOKEN : ${{ secretssecrets .GITHUB_TOKEN }}
0 commit comments