mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
chore: streamline artifact renaming and upload process in build and release workflows
This commit is contained in:
parent
ec00adcbb5
commit
a3734eb9d6
2 changed files with 46 additions and 60 deletions
53
.github/workflows/build.yml
vendored
53
.github/workflows/build.yml
vendored
|
@ -151,36 +151,20 @@ jobs:
|
||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: List Bundle Directory
|
- name: Rename and Publish Windows Artifacts
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$bundlePath = "src-tauri/target/${{ matrix.target }}/release/bundle/msi"
|
mv src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi src-tauri/target/${{ matrix.target }}/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.msi
|
||||||
if (Test-Path $bundlePath) {
|
mv src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi.sig src-tauri/target/${{ matrix.target }}/release/bundle/msi/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.msi.sig
|
||||||
Write-Output "Contents of ${bundlePath}:"
|
|
||||||
Get-ChildItem -Path $bundlePath
|
|
||||||
} else {
|
|
||||||
Write-Output "Path ${bundlePath} does not exist."
|
|
||||||
}
|
|
||||||
- name: Rename Windows Artifacts
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$bundlePath = "src-tauri/target/${{ matrix.target }}/release/bundle/msi"
|
|
||||||
$version = "${{ needs.prepare.outputs.version }}"
|
|
||||||
$arch = "${{ matrix.arch }}"
|
|
||||||
if (Test-Path $bundlePath) {
|
|
||||||
$msiFiles = Get-ChildItem -Path "$bundlePath/*.msi"
|
|
||||||
foreach ($file in $msiFiles) {
|
|
||||||
$newName = "Qopy-$version`_$arch.msi"
|
|
||||||
Rename-Item -Path $file.FullName -NewName $newName
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Error "Path ${bundlePath} does not exist."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: windows-${{ matrix.arch }}-binaries
|
name: build-windows-msi-${{ matrix.arch }}
|
||||||
path: src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
|
path: src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: updater-files-windows-${{ matrix.arch }}
|
||||||
|
path: |
|
||||||
|
src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
|
||||||
|
src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi.sig
|
||||||
|
|
||||||
build-ubuntu:
|
build-ubuntu:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
|
@ -206,7 +190,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
workspaces: "src-tauri -> target"
|
workspaces: "src-tauri -> target"
|
||||||
cache-directories: "~/.cargo/registry/index/,~/.cargo/registry/cache/,~/.cargo/git/db/"
|
cache-directories: "~/.cargo/registry/index/,~/.cargo/registry/cache/,~/.cargo/git/db/"
|
||||||
shared-key: "ubuntu-rust-cache"
|
shared-key: "linux-rust-cache"
|
||||||
save-if: "true"
|
save-if: "true"
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
@ -214,11 +198,20 @@ jobs:
|
||||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pnpm-
|
${{ runner.os }}-pnpm-
|
||||||
- name: install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
sudo dpkg --add-architecture arm64
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm
|
sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm
|
||||||
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||||
|
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||||
|
sudo apt install -y libwebkit2gtk-4.1-dev:arm64 libssl-dev:arm64 libayatana-appindicator3-dev:arm64 librsvg2-dev:arm64 libasound2-dev:arm64
|
||||||
|
fi
|
||||||
|
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
||||||
|
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
||||||
|
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||||
|
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
- run: npm install -g pnpm && pnpm install
|
- run: npm install -g pnpm && pnpm install
|
||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
|
@ -229,7 +222,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mv src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb src-tauri/target/${{ matrix.target }}/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.deb
|
mv src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb src-tauri/target/${{ matrix.target }}/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.deb
|
||||||
mv src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage src-tauri/target/${{ matrix.target }}/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.AppImage
|
mv src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage src-tauri/target/${{ matrix.target }}/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.AppImage
|
||||||
mv src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage.sig src-tauri/target/${{ matrix.target }}/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.AppImage.sig
|
|
||||||
mv src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm src-tauri/target/${{ matrix.target }}/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.rpm
|
mv src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm src-tauri/target/${{ matrix.target }}/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.rpm
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -237,5 +229,4 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
|
src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage.sig
|
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
|
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
|
||||||
|
|
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
|
@ -170,13 +170,6 @@ jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
needs: prepare
|
needs: prepare
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- target: "x86_64-unknown-linux-gnu"
|
|
||||||
arch: "x64"
|
|
||||||
- target: "aarch64-unknown-linux-gnu"
|
|
||||||
arch: "arm64"
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
|
@ -188,8 +181,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
targets: ${{ matrix.target }}
|
|
||||||
- uses: swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: "src-tauri -> target"
|
workspaces: "src-tauri -> target"
|
||||||
|
@ -219,20 +210,20 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: --target ${{ matrix.target }}
|
args: --target x86_64-unknown-linux-gnu
|
||||||
- name: Rename Linux Artifacts
|
- name: Rename Linux Artifacts
|
||||||
run: |
|
run: |
|
||||||
mv src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb src-tauri/target/${{ matrix.target }}/release/bundle/deb/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.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/${{ matrix.target }}/release/bundle/appimage/*.AppImage src-tauri/target/${{ matrix.target }}/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.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/${{ matrix.target }}/release/bundle/rpm/*.rpm src-tauri/target/${{ matrix.target }}/release/bundle/rpm/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.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:
|
||||||
name: linux-${{ matrix.arch }}-binaries
|
name: linux-binaries
|
||||||
path: |
|
path: |
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
|
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
|
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
|
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
@ -259,12 +250,19 @@ jobs:
|
||||||
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/aarch64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_silicon.dmg" | awk '{ print $1 }')
|
MAC_SILICON_HASH=$(sha256sum "artifacts/macos-silicon-binaries/aarch64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_silicon.dmg" | awk '{ print $1 }')
|
||||||
MAC_INTEL_HASH=$(sha256sum "artifacts/macos-intel-binaries/x86_64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_intel.dmg" | awk '{ print $1 }')
|
MAC_INTEL_HASH=$(sha256sum "artifacts/macos-intel-binaries/x86_64-apple-darwin/release/bundle/dmg/Qopy-${VERSION}_intel.dmg" | awk '{ print $1 }')
|
||||||
DEBIAN_X64_HASH=$(sha256sum "artifacts/linux-x64-binaries/deb/Qopy-${VERSION}_x64.deb" | awk '{ print $1 }')
|
DEBIAN_HASH=$(sha256sum "artifacts/linux-binaries/deb/Qopy-${VERSION}.deb" | awk '{ print $1 }')
|
||||||
APPIMAGE_X64_HASH=$(sha256sum "artifacts/linux-x64-binaries/appimage/Qopy-${VERSION}_x64.AppImage" | awk '{ print $1 }')
|
APPIMAGE_HASH=$(sha256sum "artifacts/linux-binaries/appimage/Qopy-${VERSION}.AppImage" | awk '{ print $1 }')
|
||||||
RPM_X64_HASH=$(sha256sum "artifacts/linux-x64-binaries/rpm/Qopy-${VERSION}_x64.rpm" | awk '{ print $1 }')
|
REDHAT_HASH=$(sha256sum "artifacts/linux-binaries/rpm/Qopy-${VERSION}.rpm" | awk '{ print $1 }')
|
||||||
DEBIAN_ARM64_HASH=$(sha256sum "artifacts/linux-arm64-binaries/deb/Qopy-${VERSION}_arm64.deb" | awk '{ print $1 }')
|
|
||||||
APPIMAGE_ARM64_HASH=$(sha256sum "artifacts/linux-arm64-binaries/appimage/Qopy-${VERSION}_arm64.AppImage" | awk '{ print $1 }')
|
# Debug output
|
||||||
RPM_ARM64_HASH=$(sha256sum "artifacts/linux-arm64-binaries/rpm/Qopy-${VERSION}_arm64.rpm" | awk '{ print $1 }')
|
echo "Calculated hashes:"
|
||||||
|
echo "Windows ARM: $WINDOWS_ARM_HASH"
|
||||||
|
echo "Windows x64: $WINDOWS_64_HASH"
|
||||||
|
echo "Mac Silicon: $MAC_SILICON_HASH"
|
||||||
|
echo "Mac Intel: $MAC_INTEL_HASH"
|
||||||
|
echo "Debian: $DEBIAN_HASH"
|
||||||
|
echo "AppImage: $APPIMAGE_HASH"
|
||||||
|
echo "Red Hat: $REDHAT_HASH"
|
||||||
|
|
||||||
RELEASE_BODY=$(cat <<-EOF
|
RELEASE_BODY=$(cat <<-EOF
|
||||||
## ♻️ Changelog
|
## ♻️ Changelog
|
||||||
|
@ -277,12 +275,9 @@ jobs:
|
||||||
- [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 (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.deb) - ${DEBIAN_X64_HASH}
|
- [Debian](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.deb) - ${DEBIAN_HASH}
|
||||||
- [AppImage (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.AppImage) - ${APPIMAGE_X64_HASH}
|
- [AppImage](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.AppImage) - ${APPIMAGE_HASH}
|
||||||
- [Red Hat (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.rpm) - ${RPM_X64_HASH}
|
- [Red Hat](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}.rpm) - ${REDHAT_HASH}
|
||||||
- [Debian (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.deb) - ${DEBIAN_ARM64_HASH}
|
|
||||||
- [AppImage (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.AppImage) - ${APPIMAGE_ARM64_HASH}
|
|
||||||
- [Red Hat (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.rpm) - ${RPM_ARM64_HASH}
|
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue