feat: add GitHub Actions build workflow

This commit is contained in:
DuckGun153 2026-06-08 23:02:05 +09:00
commit e228eeebbb

View file

@ -1,69 +1,87 @@
name: Build
name: Build Helium Browser
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
runner:
description: 'Runner'
required: true
type: string
default: 'self-hosted' # ubuntu-latest
schedule:
- cron: '0 0 */16 * *'
permissions:
contents: write
jobs:
build:
runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner || 'self-hosted' }}
runs-on: ubuntu-latest
timeout-minutes: 480
steps:
- uses: actions/checkout@v5
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Update
run: |
cd vanadium
git fetch --tags
git checkout $(git tag | sort -V | tail -n1)
cd ..
git add vanadium
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if ! git diff --staged --quiet; then
git commit -am "update"
git push
fi
submodules: recursive
fetch-depth: 0
- name: Set ENV
run: |
chmod +x *.sh
echo "unix_time=$(date +%s)" >> $GITHUB_ENV
- name: Build
- name: Configure Git
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
lsb-release file nano git curl python3 python3-pillow \
imagemagick openjdk-11-jdk-headless build-essential
- name: Install 32-bit support
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y libgcc-s1:i386
- name: Set up keystore
run: |
echo "${{ secrets.KEYSTORE_B64 }}" | base64 -d > keystore.jks
ls -lh keystore.jks
- name: Create local.properties
run: |
cat > local.properties <<EOF
keystore.path=$(pwd)/keystore.jks
keystore.password=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
- name: Set up depot_tools
run: |
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo "$(pwd)/depot_tools" >> $GITHUB_PATH
- name: Run build script
env:
DEBIAN_FRONTEND: noninteractive
LOCAL_TEST_JKS: ${{ secrets.LOCAL_TEST_JKS }}
STORE_TEST_JKS: ${{ secrets.STORE_TEST_JKS }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
./build.sh
chmod +x build.sh common.sh patch.sh
bash build.sh
- name: Set
run: |
export VERSION=$(find chromium/src/out/release -name '*arm64-v8a.apk' | sed 's/.*\///;s/\-arm64-v8a.apk$//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
mv $(find chromium/src/out/release -name '*arm64-v8a.aab') $VERSION-${{ env.unix_time }}-arm64-v8a.aab
mv $(find chromium/src/out/release -name '*arm64-v8a.apk') $VERSION-${{ env.unix_time }}-arm64-v8a.apk
mv $(find chromium/src/out/release -name '*armeabi-v7a.apk') $VERSION-${{ env.unix_time }}-armeabi-v7a.apk
- name: Publish
uses: softprops/action-gh-release@v2
- name: Upload APK artifacts
if: success()
uses: actions/upload-artifact@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
files: |
${{ env.VERSION }}-${{ env.unix_time }}-arm64-v8a.aab
${{ env.VERSION }}-${{ env.unix_time }}-arm64-v8a.apk
${{ env.VERSION }}-${{ env.unix_time }}-armeabi-v7a.apk
name: helium-apks-${{ github.run_number }}
path: chromium/src/out/release/
retention-days: 30
- name: Create GitHub Release
if: success() && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: chromium/src/out/release/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
if: always()
run: |
rm -f keystore.jks local.properties