Files

178 lines
5.4 KiB
YAML

name: Build Packages
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
platform:
description: 'Platform to build'
required: true
type: choice
options:
- all
- linux
- windows
- android
default: 'all'
jobs:
build-linux:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux'
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev cmake ninja-build clang pkg-config libgtk-3-dev liblzma-dev
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.13'
- name: Install Poetry and dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --without dev
- name: Build Linux package
run: poetry run flet build linux --no-rich-output
- name: Upload Linux artifact
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: ren-browser-linux
path: build/linux
build-windows:
runs-on: windows-latest
if: github.ref_type == 'tag' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows'
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.13'
- name: Install Poetry and dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --without dev
- name: Build Windows package
run: poetry run flet build windows --no-rich-output
env:
PYTHONIOENCODING: utf-8
PYTHONUTF8: 1
- name: Upload Windows artifact
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: ren-browser-windows
path: build/windows
build-android:
runs-on: ubuntu-latest
if: github.ref_type == 'tag' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android'
continue-on-error: true
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Set up JDK
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: 'zulu'
java-version: '17'
- name: Install Android dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang pkg-config
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.12'
- name: Install Poetry and dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --without dev
- name: Build Android APK
run: poetry run flet build apk --no-rich-output --exclude watchdog
- name: Upload APK artifact
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: ren-browser-apk
path: build/apk
create-release:
needs: [build-linux, build-windows, build-android]
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && !cancelled()
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Download Linux artifact
if: needs.build-linux.result == 'success'
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: ren-browser-linux
path: ./artifacts/linux
- name: Download Windows artifact
if: needs.build-windows.result == 'success'
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: ren-browser-windows
path: ./artifacts/windows
- name: Download APK artifact
if: needs.build-android.result == 'success'
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: ren-browser-apk
path: ./artifacts/apk
- name: Create draft release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836
if: github.ref_type == 'tag'
with:
draft: true
files: |
./artifacts/linux/*
./artifacts/windows/*
./artifacts/apk/*
name: Release ${{ github.ref_name }}
body: |
## Release ${{ github.ref_name }}
This release contains:
- Linux binary package
- Windows binary package
- Android APK package