Skip to content

Commit

Permalink
Added Windows x64 build (#8234)
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink authored Oct 28, 2024
2 parents 8319fb9 + ec91300 commit 8594e11
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
58 changes: 46 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # macos-12 is no longer on GitHub Actions, we use the Mac mini for this

include: # macos-12 is no longer on GitHub Actions, we use the Mac mini for this
- os: ubuntu-latest
architecture: x64
- os: windows-latest
architecture: x86
- os: windows-latest
architecture: x64
runs-on: ${{ matrix.os }}

steps:

########################################
# NSIS installer (Windows, always x86) #
########################################
- name: Check out SimpleFC repository (Windows)
if: matrix.os == 'windows-latest'
uses: actions/checkout@v4
Expand All @@ -35,6 +43,10 @@ jobs:
copy "Release UNICODE\nsProcess.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\nsProcess.dll"
cd ../Include
copy nsProcess.nsh "C:\Program Files (x86)\NSIS\Include\nsProcess.nsh"
#######################
# Package preparation #
#######################
- name: Check-out repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -67,10 +79,11 @@ jobs:
rm -rf pyipv8/stresstest
rm -rf pyipv8/systemd
rm -rf pyipv8/ipv8/test
- name: Setup Python
- name: Setup Python ${{ matrix.architecture }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: ${{ matrix.architecture }}
cache: 'pip'
cache-dependency-path: |
**/build/requirements.txt
Expand All @@ -86,38 +99,59 @@ jobs:
npm install
npm run build
rm -rf node_modules
- name: Determine tag
- name: Determine release tag
shell: bash
run: |
git fetch --tags
git for-each-ref --count=1 --sort=-creatordate --format '%(refname)' refs/tags > raw_tag.txt
GITHUB_TAG=$(git name-rev --tags --name-only $(cat raw_tag.txt))
echo "GITHUB_TAG=${GITHUB_TAG#v}" >> $GITHUB_ENV
#####################
# Individual builds #
#####################
- name: Build Executables (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y --allow-downgrades alien cpio=2.13+dfsg-7 devscripts fakeroot gir1.2-gtk-4.0 libgirepository1.0-dev rpm
./build/debian/makedist_debian.sh
mv build/debian/tribler_${GITHUB_TAG}_all.deb build/debian/tribler_${GITHUB_TAG}_amd64.deb
mv build/debian/tribler_${GITHUB_TAG}_all.deb build/debian/tribler_${GITHUB_TAG}_${{ matrix.architecture }}.deb
- name: Build Executables (MacOS-12)
if: matrix.os == 'macos-12'
run: |
mv ./build/tribler.spec ./tribler.spec
./build/mac/makedist_macos.sh
- uses: actions/cache/restore@v4
- name: Fetch libsodium.dll (Windows)
if: matrix.os == 'windows-latest'
id: restore_cache
with:
path: src/libsodium.dll
key: cache_libsodium_dll
run: |
vcpkg install libsodium:${{ matrix.architecture }}-windows
Copy C:/vcpkg/packages/libsodium_${{ matrix.architecture }}-windows/bin/libsodium.dll src/libsodium.dll
- name: Install OpenSSL (Windows, x86)
if: ${{ matrix.os == 'windows-latest' && matrix.architecture == 'x86'}}
run: |
Remove-Item -Path "C:\Program Files\OpenSSL" -Force -Recurse
vcpkg install openssl:x86-windows
New-Item -Path "C:\Program Files\OpenSSL" -ItemType SymbolicLink -Value "C:\vcpkg\packages\openssl_x86-windows\"
- name: Build Executables (Windows)
if: matrix.os == 'windows-latest'
run: |
(gc build/win/resources/tribler.nsi) -replace '!define BITVERSION "x86"', '!define BITVERSION "${{ matrix.architecture }}"' | Out-File -encoding ASCII build/win/resources/tribler.nsi
./build/win/makedist_win.bat
echo 'Double-check executable architectures'
echo '> Should be "${{ matrix.architecture }}"'
7z l ./dist/tribler/tribler.exe | findstr CPU
echo '> Should be "x86"'
7z l ./dist/*.exe | findstr CPU
################################
# Cleanup and artifact uploads #
################################
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} Build
name: ${{ runner.os }} ${{ matrix.architecture }} Build
path: |
dist/*.exe
dist/*.dmg
Expand Down
10 changes: 0 additions & 10 deletions build/win/locate-python.py

This file was deleted.

10 changes: 2 additions & 8 deletions build/win/resources/tribler.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,9 @@ Section "!Main EXE" SecMain
; Install MSVCR 2008, 2012 and 2015
SetOutPath "$INSTDIR"

; Libraries dependant on 2012 are: LibTorrent
; 2019-10-24: Latest version is compiled against 2015 so we don't need this dependency here. Remove it completely
; When python2 dependency is removed.
; File vc_redist_110.exe
; ExecWait "$INSTDIR\vc_redist_110.exe /q /norestart"

; Libraries dependant on 2015 are: Python, Qt5
File "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\vc_redist.x64.exe"
ExecWait "$INSTDIR\vc_redist.x64.exe /q /norestart"
File "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\vc_redist.${BITVERSION}.exe"
ExecWait "$INSTDIR\vc_redist.${BITVERSION}.exe /q /norestart"

FileOpen $9 "$INSTDIR\tribler.exe.log" w
FileWrite $9 ""
Expand Down

0 comments on commit 8594e11

Please sign in to comment.