test: update artifact naming and improve release body formatting in workflow

This commit is contained in:
PandaDEV 2024-12-21 09:44:01 +10:00
parent 56fab79713
commit e9b1d2fee8
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C

View file

@ -213,9 +213,9 @@ jobs:
args: --target x86_64-unknown-linux-gnu args: --target x86_64-unknown-linux-gnu
- name: Rename Linux Artifacts - name: Rename Linux Artifacts
run: | run: |
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}_amd64.deb mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}.deb
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_amd64.AppImage mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.AppImage
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}_amd64.rpm mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}.rpm
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -242,32 +242,33 @@ jobs:
- name: Generate Release Body - name: Generate Release Body
id: release_body id: release_body
run: | run: |
VERSION=${{ needs.prepare.outputs.version }} # Store version in a variable first
VERSION="${{ needs.prepare.outputs.version }}"
CHANGES=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s") CHANGES=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s")
# Calculate SHA256 hashes for each artifact # Calculate SHA256 hashes for each artifact
WINDOWS_ARM_HASH=$(sha256sum artifacts/windows-arm64-binaries/Qopy-$VERSION_arm64.msi | awk '{ print $1 }') WINDOWS_ARM_HASH=$(sha256sum "artifacts/windows-arm64-binaries/Qopy-${VERSION}_arm64.msi" | awk '{ print $1 }')
WINDOWS_64_HASH=$(sha256sum artifacts/windows-x64-binaries/Qopy-$VERSION_x64.msi | awk '{ print $1 }') WINDOWS_64_HASH=$(sha256sum "artifacts/windows-x64-binaries/Qopy-${VERSION}_x64.msi" | awk '{ print $1 }')
MAC_SILICON_HASH=$(sha256sum artifacts/macos-silicon-binaries/Qopy-$VERSION_silicon.dmg | awk '{ print $1 }') MAC_SILICON_HASH=$(sha256sum "artifacts/macos-silicon-binaries/Qopy-${VERSION}_silicon.dmg" | awk '{ print $1 }')
MAC_INTEL_HASH=$(sha256sum artifacts/macos-intel-binaries/Qopy-$VERSION_intel.dmg | awk '{ print $1 }') MAC_INTEL_HASH=$(sha256sum "artifacts/macos-intel-binaries/Qopy-${VERSION}_intel.dmg" | awk '{ print $1 }')
DEBIAN_HASH=$(sha256sum artifacts/linux-binaries/Qopy-$VERSION_amd64.deb | awk '{ print $1 }') DEBIAN_HASH=$(sha256sum "artifacts/linux-binaries/Qopy-${VERSION}.deb" | awk '{ print $1 }')
APPIMAGE_HASH=$(sha256sum artifacts/linux-binaries/Qopy-$VERSION_amd64.AppImage | awk '{ print $1 }') APPIMAGE_HASH=$(sha256sum "artifacts/linux-binaries/Qopy-${VERSION}.AppImage" | awk '{ print $1 }')
REDHAT_HASH=$(sha256sum artifacts/linux-binaries/Qopy-$VERSION_amd64.rpm | awk '{ print $1 }') REDHAT_HASH=$(sha256sum "artifacts/linux-binaries/Qopy-${VERSION}.rpm" | awk '{ print $1 }')
RELEASE_BODY=$(cat <<-EOF RELEASE_BODY=$(cat <<-EOF
## ♻️ Changelog ## ♻️ Changelog
$CHANGES $CHANGES
⬇️ Downloads ## ⬇️ Downloads
- [Windows (x64)](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_x64.msi) - $WINDOWS_64_HASH - [Windows (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.msi) - $WINDOWS_64_HASH
- [Windows (ARM64)](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_arm64.msi) - $WINDOWS_ARM_HASH - [Windows (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.msi) - $WINDOWS_ARM_HASH
- [macOS (Silicon)](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_silicon.dmg) - $MAC_SILICON_HASH - [macOS (Silicon)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_silicon.dmg) - $MAC_SILICON_HASH
- [macOS (Intel)](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_intel.dmg) - $MAC_INTEL_HASH - [macOS (Intel)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_intel.dmg) - $MAC_INTEL_HASH
- [Debian](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_amd64.deb) - $DEBIAN_HASH - [Debian](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.deb) - $DEBIAN_HASH
- [AppImage](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_amd64.AppImage) - $APPIMAGE_HASH - [AppImage](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.AppImage) - $APPIMAGE_HASH
- [Red Hat](https://github.com/${{ github.repository }}/releases/download/v$VERSION/Qopy-$VERSION_amd64.rpm) - $REDHAT_HASH - [Red Hat](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.rpm) - $REDHAT_HASH
EOF EOF
) )