This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
Updated builders to use GitHub Actions #54
Workflow file for this run
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: pull_request # TODO: Only run on workflow_dispatch | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] # TODO: Run all [macos-12, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
fetch-tags: 'true' | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
cache-dependency-path: | | |
**/requirements-build.txt | |
- name: Install Dependencies | |
run: | | |
pip install --upgrade -r requirements-build.txt | |
- name: Setup npm | |
uses: actions/setup-node@v4 | |
- name: Build npm | |
run: | | |
cd src/tribler/ui/ | |
npm install | |
npm run build | |
- name: Determine tag | |
run: | | |
git fetch --tags | |
git for-each-ref --count=1 --sort=-creatordate --format '%(refname)' refs/tags > raw_tag.txt | |
echo "GITHUB_TAG=$(git name-rev --tags --name-only $(cat raw_tag.txt))" >> $GITHUB_ENV | |
- name: Prepare version | |
shell: python | |
env: | |
GITHUB_REF: ${{ vars.GITHUB_SHA }} | |
GITHUB_TAG: ${{ env.GITHUB_TAG }} | |
run: | | |
from os import getenv | |
from time import ctime | |
print(f'Writing version ({getenv("GITHUB_SHA")}, {getenv("GITHUB_TAG")})') | |
with open("src/tribler/core/version.py", "w") as version_py: | |
version_py.write(f'version_id = "{getenv("GITHUB_TAG")}"\n') | |
version_py.write(f'build_date = "{ctime()}"\n') | |
version_py.write(f'commit_id = "{getenv("GITHUB_SHA")}"\n') | |
- name: Build Executables (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get install -y --allow-downgrades alien cpio=2.13+dfsg-7 fakeroot rpm python3-gi | |
./build/debian/makedist_debian.sh | |
- name: Build Executables (MacOS-12) | |
if: matrix.os == 'macos-12' | |
run: | | |
./build/mac/makedist_macos.sh | |
- name: Build Executables (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
./build/win/makedist_win.bat | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }} Build | |
path: | | |
dist/* |