Build #145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: workflow_dispatch | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: # macos-12 is no longer on GitHub Actions, we use the Mac mini for this | |
- os: ubuntu-20.04 | |
architecture: x64 | |
- os: ubuntu-latest | |
architecture: aarch64 | |
- 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 | |
with: | |
repository: mazinsw/SimpleFC | |
- name: Build SimpleFC NSIS Plugin (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
copy "bin\x86-unicode\SimpleFC.dll" "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\SimpleFC.dll" | |
- name: Check out nsProcess repository (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: actions/checkout@v4 | |
with: | |
repository: simdsoft/nsProcess | |
submodules: 'true' | |
- name: Add msbuild to PATH (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build nsProcess NSIS Plugin (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
cd nsProcess | |
msbuild nsProcess.vcxproj /p:PlatformToolset=v143 /p:Configuration="Release UNICODE" | |
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: | |
submodules: 'true' | |
fetch-tags: 'true' | |
- name: Remove test files | |
shell: bash | |
run: | | |
rm -rf doc | |
rm -rf scripts | |
rm src/run_unit_tests.py | |
rm -rf src/tribler/test_integration | |
rm -rf src/tribler/test_unit | |
rm -rf pyipv8/.github | |
rm pyipv8/.gitignore | |
rm pyipv8/.gitmodules | |
rm pyipv8/.readthedocs.yaml | |
rm pyipv8/.ruff.toml | |
rm pyipv8/*.md | |
rm pyipv8/*.ini | |
rm pyipv8/create_setup_taskmanager.py | |
rm pyipv8/create_test_coverage_report.py | |
rm pyipv8/github_increment_version.py | |
rm pyipv8/run_all_tests.py | |
rm pyipv8/setup.py | |
rm -rf pyipv8/doc | |
rm -rf pyipv8/scripts | |
rm -rf pyipv8/stresstest | |
rm -rf pyipv8/systemd | |
rm -rf pyipv8/ipv8/test | |
- name: Setup Python ${{ matrix.architecture }} | |
if: matrix.architecture != 'aarch64' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
architecture: ${{ matrix.architecture }} | |
cache: 'pip' | |
cache-dependency-path: | | |
**/build/requirements.txt | |
- name: Install Dependencies | |
if: matrix.architecture != 'aarch64' | |
run: | | |
pip install --upgrade -r build/requirements.txt | |
- name: Setup npm | |
uses: actions/setup-node@v4 | |
- name: Build npm | |
shell: bash | |
run: | | |
cd src/tribler/ui/ | |
npm install | |
npm run build | |
rm -rf node_modules | |
- 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 x64) | |
if: matrix.os == 'ubuntu-20.04' && matrix.architecture == 'x64' | |
run: | | |
sudo apt-get update -q -y | |
sudo apt-get install -y --allow-downgrades alien devscripts fakeroot gir1.2-gtk-3.0 libgirepository1.0-dev rpm | |
./build/debian/makedist_debian.sh | |
cd build/debian | |
sudo apt-get install -y --fix-broken ./tribler_${GITHUB_TAG}_all.deb | |
timeout 10s tribler -s || true | |
cat /tmp/*tribler*.log | |
mv tribler_${GITHUB_TAG}_all.deb tribler_${GITHUB_TAG}_${{ matrix.architecture }}.deb | |
- name: Build Executables (Ubuntu aarch64) | |
if: matrix.os == 'ubuntu-latest' && matrix.architecture == 'aarch64' | |
uses: uraimo/run-on-arch-action@v2 | |
id: run_ubuntu_aarch64 | |
with: | |
arch: ${{ matrix.architecture }} | |
distro: ubuntu22.04 | |
githubToken: ${{ github.token }} | |
dockerRunArgs: | | |
--volume "${PWD}:/tribler" | |
env: | | |
GITHUB_TAG: ${{ env.GITHUB_TAG }} | |
shell: /bin/sh | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y --allow-downgrades alien cpio=2.13+dfsg-7 devscripts fakeroot gir1.2-gtk-4.0 libgirepository1.0-dev rpm python3-pip libcairo2-dev | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade -r /tribler/build/requirements.txt | |
python3 -m pip install meson ninja | |
cd /tribler | |
cp /lib/${{ matrix.architecture }}-linux-gnu/libcrypt.so.1 libcrypt-06cd74a6.so.2 # cx_Freeze workaround | |
export PATH="/usr/local/bin:$PATH" | |
./build/debian/makedist_debian.sh | |
cd build/debian | |
apt-get install -y --fix-broken ./tribler_${GITHUB_TAG}_all.deb | |
timeout 10s tribler -s || true | |
cat /tmp/*tribler*.log | |
mv tribler_${GITHUB_TAG}_all.deb 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 | |
- name: Fetch libsodium.dll (Windows) | |
if: matrix.os == 'windows-latest' | |
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 }} ${{ matrix.architecture }} Build | |
path: | | |
dist/*.exe | |
dist/*.dmg | |
build/debian/*.deb |