mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
chore: refine Windows and Linux build workflows with improved artifact listing and renaming
This commit is contained in:
parent
d4d15f085a
commit
b706207aaf
1 changed files with 22 additions and 58 deletions
80
.github/workflows/build.yml
vendored
80
.github/workflows/build.yml
vendored
|
@ -151,7 +151,9 @@ 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 Build Directories
|
with:
|
||||||
|
args: ${{ matrix.args }}
|
||||||
|
- name: List Bundle Directory
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
Write-Output "Checking build directories..."
|
Write-Output "Checking build directories..."
|
||||||
|
@ -161,51 +163,31 @@ jobs:
|
||||||
Write-Output "Found MSI file: $($_.FullName)"
|
Write-Output "Found MSI file: $($_.FullName)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Rename Windows Artifacts
|
- name: Rename Windows Artifacts
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$targetPath = "src-tauri/target/${{ matrix.target }}/release/bundle/msi"
|
|
||||||
$version = "${{ needs.prepare.outputs.version }}"
|
$version = "${{ needs.prepare.outputs.version }}"
|
||||||
$arch = "${{ matrix.arch }}"
|
$arch = "${{ matrix.arch }}"
|
||||||
|
|
||||||
Write-Output "Looking for MSI files in: $targetPath"
|
# Find MSI files recursively
|
||||||
|
$msiFiles = Get-ChildItem -Path "src-tauri/target" -Recurse -Filter "*.msi"
|
||||||
if (!(Test-Path $targetPath)) {
|
|
||||||
Write-Error "Target path does not exist: $targetPath"
|
|
||||||
Write-Output "Available directories:"
|
|
||||||
Get-ChildItem -Path "src-tauri/target" -Recurse -Directory | Format-Table -Property FullName
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
$msiFiles = Get-ChildItem -Path "$targetPath/*.msi" -ErrorAction SilentlyContinue
|
|
||||||
if ($null -eq $msiFiles) {
|
|
||||||
Write-Error "No MSI files found in: $targetPath"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($file in $msiFiles) {
|
foreach ($file in $msiFiles) {
|
||||||
$newName = "Qopy-${version}_${arch}.msi"
|
$newName = "Qopy-${version}_${arch}.msi"
|
||||||
Write-Output "Renaming $($file.Name) to $newName"
|
Write-Output "Renaming $($file.Name) to $newName"
|
||||||
Rename-Item -Path $file.FullName -NewName $newName -ErrorAction Stop
|
Rename-Item -Path $file.FullName -NewName $newName
|
||||||
|
$newPath = Join-Path $file.Directory.FullName $newName
|
||||||
|
Write-Output "New file path: $newPath"
|
||||||
}
|
}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: windows-${{ matrix.arch }}-binaries
|
name: windows-${{ matrix.arch }}-binaries
|
||||||
path: |
|
path: |
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
|
src-tauri/target/**/release/bundle/msi/*.msi
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi.sig
|
src-tauri/target/**/release/bundle/msi/*.msi.sig
|
||||||
|
|
||||||
build-ubuntu:
|
build-ubuntu:
|
||||||
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 }}
|
||||||
|
@ -216,7 +198,7 @@ jobs:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: x86_64-unknown-linux-gnu
|
||||||
- uses: swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: "src-tauri -> target"
|
workspaces: "src-tauri -> target"
|
||||||
|
@ -231,44 +213,26 @@ jobs:
|
||||||
${{ runner.os }}-pnpm-
|
${{ runner.os }}-pnpm-
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture arm64
|
|
||||||
# Update sources.list to use jammy (22.04)
|
|
||||||
sudo sed -i 's/noble/jammy/g' /etc/apt/sources.list
|
|
||||||
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
|
||||||
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
||||||
|
|
||||||
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
|
|
||||||
# Install ARM64 dependencies from jammy
|
|
||||||
sudo apt install -y \
|
|
||||||
libwebkit2gtk-4.1-dev:arm64 \
|
|
||||||
libssl-dev:arm64 \
|
|
||||||
libayatana-appindicator3-dev:arm64 \
|
|
||||||
librsvg2-dev:arm64 \
|
|
||||||
libasound2-dev:arm64
|
|
||||||
|
|
||||||
# Set up cross-compilation environment
|
|
||||||
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
|
||||||
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
|
||||||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $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:
|
||||||
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/appimage/*.AppImage.sig src-tauri/target/${{ matrix.target }}/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.AppImage.sig
|
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/Qopy-${{ needs.prepare.outputs.version }}.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/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
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: linux-${{ matrix.arch }}-binaries
|
name: linux-x64-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/appimage/*.AppImage.sig
|
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.sig
|
||||||
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
|
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/rpm/*.rpm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue