Skip to content

Commit 6ba2677

Browse files
authored
ci: enhance Linux and Windows package workflow (#1071)
* ci: fix Linux packaging workflow with specific Ubuntu 20.04 image * ci: use Compress-Archive in Windows try to prevent Defender false positives
1 parent 978801c commit 6ba2677

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/package.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99
jobs:
1010
windows:
1111
name: Package Windows
12-
runs-on: ubuntu-latest
12+
runs-on: windows-2019
1313
strategy:
1414
matrix:
15-
runtime: [win-x64, win-arm64]
15+
runtime: [ win-x64, win-arm64 ]
1616
steps:
1717
- name: Checkout sources
1818
uses: actions/checkout@v4
@@ -22,6 +22,7 @@ jobs:
2222
name: sourcegit.${{ matrix.runtime }}
2323
path: build/SourceGit
2424
- name: Package
25+
shell: bash
2526
env:
2627
VERSION: ${{ inputs.version }}
2728
RUNTIME: ${{ matrix.runtime }}
@@ -69,6 +70,7 @@ jobs:
6970
linux:
7071
name: Package Linux
7172
runs-on: ubuntu-latest
73+
container: ubuntu:20.04
7274
strategy:
7375
matrix:
7476
runtime: [linux-x64, linux-arm64]
@@ -77,9 +79,10 @@ jobs:
7779
uses: actions/checkout@v4
7880
- name: Download package dependencies
7981
run: |
80-
sudo add-apt-repository universe
81-
sudo apt-get update
82-
sudo apt-get install desktop-file-utils rpm libfuse2
82+
export DEBIAN_FRONTEND=noninteractive
83+
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
84+
apt-get update
85+
apt-get install -y curl wget git dpkg-dev fakeroot tzdata zip unzip desktop-file-utils rpm libfuse2 file build-essential binutils
8386
- name: Download build
8487
uses: actions/download-artifact@v4
8588
with:
@@ -89,6 +92,7 @@ jobs:
8992
env:
9093
VERSION: ${{ inputs.version }}
9194
RUNTIME: ${{ matrix.runtime }}
95+
APPIMAGE_EXTRACT_AND_RUN: 1
9296
run: |
9397
mkdir build/SourceGit
9498
tar -xf "build/sourcegit.${{ matrix.runtime }}.tar" -C build/SourceGit

build/scripts/package.windows.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ cd build
99

1010
rm -rf SourceGit/*.pdb
1111

12-
zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit
12+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
13+
powershell -Command "Compress-Archive -Path SourceGit\\* -DestinationPath \"sourcegit_$VERSION.$RUNTIME.zip\" -Force"
14+
else
15+
zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit
16+
fi

0 commit comments

Comments
 (0)