-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Updated builders to use GitHub Actions
- Loading branch information
Showing
17 changed files
with
152 additions
and
293 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Build | ||
on: workflow_dispatch | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [macos-12, ubuntu-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- 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" | ||
- 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 | ||
shell: bash | ||
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: 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 rpm | ||
./build/debian/makedist_debian.sh | ||
- name: Build Executables (MacOS-12) | ||
if: matrix.os == 'macos-12' | ||
run: | | ||
./build/mac/makedist_macos.sh | ||
- uses: actions/cache/restore@v4 | ||
if: matrix.os == 'windows-latest' | ||
id: restore_cache | ||
with: | ||
path: src/libsodium.dll | ||
key: cache_libsodium_dll | ||
- name: Build Executables (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
./build/win/makedist_win.bat | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ runner.os }} Build | ||
path: | | ||
dist/*.exe | ||
dist/*.dmg | ||
build/debian/*.deb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,53 +2,28 @@ | |
set -x # print all commands | ||
set -e # exit when any command fails | ||
|
||
LOG_LEVEL=${LOG_LEVEL:-"DEBUG"} | ||
|
||
if [[ ! -d build/debian ]]; then | ||
echo "Please run this script from project root as:\n./build/debian/makedist_debian.sh" | ||
fi | ||
|
||
rm -rf build/tribler | ||
rm -rf dist/tribler | ||
rm -rf build/debian/tribler/usr/share/tribler | ||
|
||
if [ ! -z "$VENV" ]; then | ||
echo "Setting venv to $VENV" | ||
source $VENV/bin/activate | ||
else | ||
echo "Creating a new venv" | ||
python3 -m venv build-env | ||
. ./build-env/bin/activate | ||
fi | ||
|
||
# ----- Install dependencies before the build | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install --upgrade -r requirements-build.txt | ||
python3 -m pip install --upgrade PyGObject | ||
|
||
# ----- Update version | ||
python3 ./build/update_version.py -r . | ||
python3 ./build/debian/update_metainfo.py -r . | ||
|
||
# ----- Build UI | ||
pushd . | ||
cd src/tribler/ui/ | ||
npm install | ||
npm run build | ||
popd | ||
python3 ./build/debian/update_metainfo.py | ||
|
||
# ----- Build binaries | ||
echo Building Tribler using Cx_Freeze | ||
python3 setup.py build | ||
|
||
# ----- Build dpkg | ||
cp -r ./dist/tribler ./build/debian/tribler/usr/share/tribler | ||
|
||
TRIBLER_VERSION=$(head -n 1 .TriblerVersion) # read the first line only | ||
|
||
# Compose the changelog | ||
cd ./build/debian/tribler | ||
|
||
dch -v $TRIBLER_VERSION "New release" | ||
dch -v $TRIBLER_VERSION "See https://github.com/Tribler/tribler/releases/tag/$TRIBLER_VERSION for more info" | ||
export DEBEMAIL="[email protected]" | ||
export DEBFULLNAME="Tribler" | ||
dch -v $GITHUB_TAG "New release" | ||
dch -v $GITHUB_TAG "See https://github.com/Tribler/tribler/releases/tag/$GITHUB_TAG for more info" | ||
|
||
dpkg-buildpackage -b -rfakeroot -us -uc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
tribler (7.0.0) unstable; urgency=medium | ||
|
||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v7.0.0 for more info. | ||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v7.0.0 for more info. | ||
|
||
-- Tribler <[email protected]> Thu, 25 Jan 2018 12:31:00 +0100 | ||
|
||
tribler (6.5.2) unstable; urgency=medium | ||
|
||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.2 for more info. | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.1 for more info. | ||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.2 for more info. | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.1 for more info. | ||
|
||
-- whirm <[email protected]> Fri, 13 May 2016 12:04:44 +0200 | ||
|
||
tribler (6.5.0) unstable; urgency=medium | ||
|
||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.0 for more info. | ||
* New release | ||
* See https://github.com/Tribler/tribler/releases/tag/v6.5.0 for more info. | ||
|
||
-- whirm <[email protected]> Fri, 12 Feb 2016 11:24:43 +0100 | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,12 @@ | ||
import logging | ||
import time | ||
import xml.etree.ElementTree as xml | ||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
|
||
import defusedxml.ElementTree as defxml | ||
|
||
logger = logging.getLogger(__name__) | ||
logging.basicConfig(level=logging.INFO) | ||
|
||
|
||
def parse_arguments(): | ||
parser = ArgumentParser(description='Update Tribler metainfo.xml') | ||
parser.add_argument('-r', '--repo', type=str, help='path to a repository folder', default='.') | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == '__main__': | ||
arguments = parse_arguments() | ||
|
||
version = Path('.TriblerVersion').read_text().lstrip('v').rstrip('\n') | ||
|
||
release_info = { | ||
'version': version, | ||
'date': time.strftime("%Y-%m-%d", time.localtime()) | ||
} | ||
|
||
logger.info(f'Release info: {release_info}') | ||
metainfo_xml = Path(arguments.repo) / 'build/debian/tribler/usr/share/metainfo/org.tribler.Tribler.metainfo.xml' | ||
|
||
xml_dom = defxml.parse(metainfo_xml) | ||
releases = xml_dom.getroot().find('releases') | ||
release = xml.SubElement(releases, 'release', release_info) | ||
|
||
xml_dom.write(metainfo_xml, encoding='utf-8', xml_declaration=True) | ||
logger.info(f'Content of metainfo.xml: {metainfo_xml.read_text()}') | ||
from os import getenv | ||
from time import localtime, strftime | ||
from xml.etree.ElementTree import SubElement, parse | ||
|
||
if __name__ == "__main__": | ||
metainfo_xml = "build/debian/tribler/usr/share/metainfo/org.tribler.Tribler.metainfo.xml" | ||
tree = parse(metainfo_xml) | ||
root = tree.getroot() | ||
releases_tag = root.find("releases") | ||
releases_tag.append(SubElement(releases_tag, "release", {"version": getenv("GITHUB_TAG"), | ||
"date": strftime("%Y-%m-%d", localtime())})) | ||
tree.write(metainfo_xml, encoding="utf-8", xml_declaration=True) |
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
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.