Packages come from waozi.xyz, not the app store, so automatic updates now wait for an answer. Apps asks once with two equal buttons and says the store does not check these updates; Settings > About changes the answer. The new key replaces cells_auto_update, which was saved as on without asking. F-Droid rebuilds Inbe and compares it with our signed APK. Release builds now also sign the universal APK built with -PfDroidBuild (self-update off) and publish it as inbe-VERSION-fdroid.apk for F-Droid's Binaries field.
1471 lines
50 KiB
YAML
1471 lines
50 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'src/**'
|
|
- '!src/cells/versions.zi'
|
|
- 'droid/**'
|
|
- 'apps/publishers.json'
|
|
- 'CHANGELOG.md'
|
|
- 'Makefile'
|
|
- 'ziran.lock'
|
|
- 'scripts/**'
|
|
- '!scripts/package-release.py'
|
|
- '!scripts/update-package-version.py'
|
|
- '!scripts/generate-package-versions.py'
|
|
- '!scripts/prepare-package-assets.py'
|
|
- '!scripts/check-package-versions.py'
|
|
- '!scripts/package-manifests.py'
|
|
- 'packaging/**'
|
|
- '.github/workflows/release.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
secret-scan:
|
|
name: Secret Scan
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
with:
|
|
save-toolchain: 'false'
|
|
|
|
- name: Require configured app publisher
|
|
run: python3 scripts/check-package-publishers.py
|
|
|
|
- name: Check Version Consistency
|
|
run: |
|
|
python3 scripts/check-version.py
|
|
python3 tests/version_test.py
|
|
|
|
- name: Scan Tracked Files and History
|
|
run: |
|
|
set -euo pipefail
|
|
python3 scripts/check-secrets.py --working-tree
|
|
python3 scripts/check-secrets.py --history
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
needs: secret-scan
|
|
timeout-minutes: 60
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
lfs: true
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Test apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: test-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/test-packages.txt') }}
|
|
restore-keys: |
|
|
test-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Test Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/test-packages.txt
|
|
|
|
- name: Run Tests
|
|
run: make test
|
|
|
|
- name: Require Visual Tests
|
|
run: make visual-test
|
|
|
|
- name: Run Packages Across App Versions
|
|
run: make package-compat-test
|
|
|
|
- name: Save Visual Test Evidence
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-visual-tests
|
|
path: |
|
|
build/visual-test/
|
|
build/native-visual-test/
|
|
build/native-zoom-test/*.png
|
|
build/native-zoom-test/app.log
|
|
build/launcher-ui-test/
|
|
build/locale-render-ui-test/
|
|
build/native-screenshot-test/
|
|
build/native-text-pixels-test/*.png
|
|
build/native-text-pixels-test/*.log
|
|
build/settings-sidebar-test/
|
|
build/startup-quit-test/
|
|
build/lumi-ui-test/
|
|
build/lumi-history-ui-test/
|
|
build/habits-table-ui-test/
|
|
build/lists-ui-test/
|
|
build/sync-review-ui-test/
|
|
build/data-back-ui-test/
|
|
build/leaderboard-ui-test/
|
|
build/practice-images-ui-test/
|
|
retention-days: 7
|
|
|
|
build-web:
|
|
name: Build Web
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
lfs: true
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Web apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
|
|
restore-keys: |
|
|
web-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Web Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt
|
|
|
|
- name: Set up Emscripten
|
|
uses: ./.github/actions/emscripten
|
|
|
|
- name: Build Web ZIP
|
|
run: |
|
|
set -euo pipefail
|
|
export PATH="$INBE_NODE_BIN:$PATH"
|
|
node --version
|
|
make package-unpackaged-assets
|
|
make web
|
|
mkdir -p build/release/web
|
|
cp build/dist/inbe-web.zip build/release/web/
|
|
|
|
- name: Upload Web Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-web
|
|
path: build/release/web/*
|
|
if-no-files-found: error
|
|
|
|
build-chrome-extension:
|
|
name: Build Chrome Extension
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
lfs: true
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Web apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
|
|
restore-keys: |
|
|
web-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Web Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt
|
|
|
|
- name: Set up Emscripten
|
|
uses: ./.github/actions/emscripten
|
|
|
|
- name: Build Chrome Extension ZIP
|
|
run: |
|
|
set -euo pipefail
|
|
export PATH="$INBE_NODE_BIN:$PATH"
|
|
node --version
|
|
make package-unpackaged-assets
|
|
make chrome-web-store
|
|
mkdir -p build/release/chrome-web-store
|
|
cp build/dist/inbe-chrome-web-store.zip build/release/chrome-web-store/
|
|
|
|
- name: Upload Chrome Extension Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-chrome-web-store
|
|
path: build/release/chrome-web-store/*
|
|
if-no-files-found: error
|
|
|
|
build-firefox-addons:
|
|
name: Build Firefox Add-on
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
lfs: true
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Web apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: web-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/web-packages.txt') }}
|
|
restore-keys: |
|
|
web-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Web Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/web-packages.txt
|
|
|
|
- name: Set up Emscripten
|
|
uses: ./.github/actions/emscripten
|
|
|
|
- name: Build Firefox Add-on ZIP
|
|
run: |
|
|
set -euo pipefail
|
|
export PATH="$INBE_NODE_BIN:$PATH"
|
|
node --version
|
|
make package-unpackaged-assets
|
|
make firefox-addons
|
|
make firefox-addons-lint
|
|
mkdir -p build/release/firefox-addons
|
|
cp build/dist/inbe-firefox-addons.zip build/release/firefox-addons/
|
|
|
|
- name: Upload Firefox Add-on Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-firefox-addons
|
|
path: build/release/firefox-addons/*
|
|
if-no-files-found: error
|
|
|
|
build-linux-appimage:
|
|
name: Build Linux AppImage
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-22.04
|
|
tool_arch: x86_64
|
|
- arch: aarch64
|
|
runner: ubuntu-22.04-arm
|
|
tool_arch: aarch64
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Linux apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: linux-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/linux-packages.txt') }}
|
|
restore-keys: |
|
|
linux-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Linux Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/linux-packages.txt
|
|
|
|
- name: Install AppImage Tools
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p "$HOME/.local/bin"
|
|
curl -L -o "$HOME/.local/bin/linuxdeploy" \
|
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${{ matrix.tool_arch }}.AppImage
|
|
curl -L -o "$HOME/.local/bin/linuxdeploy-plugin-appimage" \
|
|
https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-appimage-${{ matrix.tool_arch }}.AppImage
|
|
curl -L -o "$HOME/.local/bin/appimagetool" \
|
|
https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${{ matrix.tool_arch }}.AppImage
|
|
chmod +x "$HOME/.local/bin/linuxdeploy" "$HOME/.local/bin/linuxdeploy-plugin-appimage" "$HOME/.local/bin/appimagetool"
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Build Linux AppImage
|
|
env:
|
|
APPIMAGE_EXTRACT_AND_RUN: "1"
|
|
RAY_RAYLIB_CONFIG: -DSUPPORT_SCREEN_CAPTURE=0 -DSUPPORT_COMPRESSION_API=0 -DSUPPORT_AUTOMATION_EVENTS=0 -DSUPPORT_CLIPBOARD_IMAGE=0 -DSUPPORT_FILEFORMAT_BMP=0 -DSUPPORT_FILEFORMAT_GIF=0 -DSUPPORT_FILEFORMAT_QOI=0 -DSUPPORT_FILEFORMAT_DDS=0 -DSUPPORT_FILEFORMAT_TTF=1
|
|
run: |
|
|
set -euo pipefail
|
|
RAY_SDL_INCLUDE_DIR="$(pkg-config --variable=includedir sdl2 | sed 's,/SDL2$,,')"
|
|
RAY_CFLAGS="$(pkg-config --cflags sdl2 libdrm gbm egl glesv2)"
|
|
RAY_LDLIBS="$(pkg-config --libs sdl2 libdrm gbm egl glesv2)"
|
|
RAY_SDL_LDLIBS="$(pkg-config --libs sdl2)"
|
|
export RAY_SDL_INCLUDE_DIR RAY_CFLAGS RAY_LDLIBS RAY_SDL_LDLIBS
|
|
make appimage
|
|
mkdir -p build/release/linux
|
|
find build/dist/linux -maxdepth 1 -type f -name '*.AppImage' -exec cp {} build/release/linux/ \;
|
|
test -n "$(find build/release/linux -type f -print -quit)"
|
|
|
|
- name: Smoke Test Linux AppImage
|
|
timeout-minutes: 5
|
|
env:
|
|
APPIMAGE_EXTRACT_AND_RUN: "1"
|
|
DISPLAY: ":99"
|
|
run: |
|
|
set -euo pipefail
|
|
appimage="$(find build/release/linux -maxdepth 1 -type f -name '*.AppImage' | head -n 1)"
|
|
chmod +x "$appimage"
|
|
Xvfb "$DISPLAY" -screen 0 800x600x24 >/tmp/inbe-xvfb.log 2>&1 &
|
|
xvfb_pid=$!
|
|
trap 'kill "$app_pid" "$xvfb_pid" >/dev/null 2>&1 || true' EXIT
|
|
sleep 2
|
|
"$appimage" >/tmp/inbe-appimage.log 2>&1 &
|
|
app_pid=$!
|
|
for _ in $(seq 1 30); do
|
|
if xwininfo -tree -root | grep -q 'Inner Breeze'; then
|
|
sleep 3
|
|
# A build without TrueType support draws a pixel font.
|
|
if grep -q 'Font is not supported' /tmp/inbe-appimage.log; then
|
|
echo "AppImage could not load its fonts"
|
|
cat /tmp/inbe-appimage.log || true
|
|
exit 1
|
|
fi
|
|
exit 0
|
|
fi
|
|
if ! kill -0 "$app_pid" >/dev/null 2>&1; then
|
|
echo "AppImage exited before opening a window"
|
|
cat /tmp/inbe-appimage.log || true
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo "AppImage did not open an X11 window within 30 seconds"
|
|
cat /tmp/inbe-appimage.log || true
|
|
exit 1
|
|
|
|
- name: Upload Linux AppImage Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-appimage-${{ matrix.arch }}
|
|
path: build/release/linux/*
|
|
if-no-files-found: error
|
|
|
|
build-linux-deb:
|
|
name: Build Linux Deb
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: amd64
|
|
runner: ubuntu-22.04
|
|
- arch: arm64
|
|
runner: ubuntu-22.04-arm
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Linux apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: linux-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/linux-packages.txt') }}
|
|
restore-keys: |
|
|
linux-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Linux Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/linux-packages.txt
|
|
|
|
- name: Build Debian Package
|
|
run: |
|
|
set -euo pipefail
|
|
make deb
|
|
mkdir -p build/release/linux
|
|
find build/dist/deb -maxdepth 1 -type f -name '*.deb' -exec cp {} build/release/linux/ \;
|
|
deb="$(find build/release/linux -maxdepth 1 -type f -name '*.deb' | head -n 1)"
|
|
test -n "$deb"
|
|
dpkg-deb --info "$deb"
|
|
dpkg-deb --contents "$deb" >/dev/null
|
|
|
|
- name: Upload Linux Deb Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-deb-${{ matrix.arch }}
|
|
path: build/release/linux/*
|
|
if-no-files-found: error
|
|
|
|
build-linux-rpm:
|
|
name: Build Linux RPM
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-22.04
|
|
- arch: aarch64
|
|
runner: ubuntu-22.04-arm
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Linux apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: linux-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/linux-packages.txt') }}
|
|
restore-keys: |
|
|
linux-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Linux Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/linux-packages.txt
|
|
|
|
- name: Build RPM Package
|
|
run: |
|
|
set -euo pipefail
|
|
make rpm
|
|
mkdir -p build/release/linux
|
|
find build/dist/rpm -maxdepth 1 -type f -name '*.rpm' -exec cp {} build/release/linux/ \;
|
|
rpm_package="$(find build/release/linux -maxdepth 1 -type f -name '*.rpm' | head -n 1)"
|
|
test -n "$rpm_package"
|
|
rpm -qip "$rpm_package"
|
|
rpm -qlp "$rpm_package" >/dev/null
|
|
|
|
- name: Upload Linux RPM Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-rpm-${{ matrix.arch }}
|
|
path: build/release/linux/*
|
|
if-no-files-found: error
|
|
|
|
build-linux-snap:
|
|
name: Build Linux Snap
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-22.04
|
|
- arch: aarch64
|
|
runner: ubuntu-22.04-arm
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Linux apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: linux-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/linux-packages.txt') }}
|
|
restore-keys: |
|
|
linux-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Linux Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/linux-packages.txt
|
|
|
|
- name: Build Snap Package
|
|
run: |
|
|
set -euo pipefail
|
|
make snap
|
|
mkdir -p build/release/linux
|
|
find build/dist/snap -maxdepth 1 -type f -name '*.snap' -exec cp {} build/release/linux/ \;
|
|
test -n "$(find build/release/linux -maxdepth 1 -type f -name '*.snap' -print -quit)"
|
|
|
|
- name: Upload Linux Snap Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-snap-${{ matrix.arch }}
|
|
path: build/release/linux/*
|
|
if-no-files-found: error
|
|
|
|
build-linux-flatpak:
|
|
name: Build Linux Flatpak
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-22.04
|
|
- arch: aarch64
|
|
runner: ubuntu-22.04-arm
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Linux apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: linux-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/linux-packages.txt') }}
|
|
restore-keys: |
|
|
linux-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Linux Dependencies
|
|
timeout-minutes: 15
|
|
run: .github/scripts/install-apt-packages.sh .github/apt/linux-packages.txt
|
|
|
|
- name: Build Flatpak Bundle
|
|
run: |
|
|
set -euo pipefail
|
|
make flatpak
|
|
mkdir -p build/release/linux
|
|
find build/dist/flatpak -maxdepth 1 -type f -name '*.flatpak' -exec cp {} build/release/linux/ \;
|
|
test -n "$(find build/release/linux -maxdepth 1 -type f -name '*.flatpak' -print -quit)"
|
|
|
|
- name: Upload Linux Flatpak Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-linux-flatpak-${{ matrix.arch }}
|
|
path: build/release/linux/*
|
|
if-no-files-found: error
|
|
|
|
build-windows:
|
|
name: Build Windows
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
env:
|
|
APT_CACHE_DIR: /tmp/apt-cache
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Cache Windows apt packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.APT_CACHE_DIR }}
|
|
key: windows-apt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/apt/windows-packages.txt') }}
|
|
restore-keys: |
|
|
windows-apt-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Cache Windows vendor builds
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
vendor-builds/windows
|
|
vendor-builds/sqlite
|
|
key: windows-vendor-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile', 'ziran.lock') }}
|
|
restore-keys: |
|
|
windows-vendor-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Windows Dependencies
|
|
timeout-minutes: 15
|
|
run: |
|
|
set -euo pipefail
|
|
.github/scripts/install-apt-packages.sh .github/apt/windows-packages.txt
|
|
if [ -x /usr/bin/x86_64-w64-mingw32-gcc-win32 ]; then
|
|
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-win32
|
|
fi
|
|
|
|
- name: Build Windows ZIP and Setup
|
|
run: |
|
|
set -euo pipefail
|
|
make windows windows-setup
|
|
mkdir -p build/release/windows
|
|
find build/dist/windows -maxdepth 1 -type f \( -name '*.zip' -o -name '*-setup-*.exe' \) -exec cp {} build/release/windows/ \;
|
|
test -n "$(find build/release/windows -type f -print -quit)"
|
|
|
|
- name: Upload Windows Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-windows
|
|
path: build/release/windows/*
|
|
if-no-files-found: error
|
|
|
|
build-android:
|
|
name: Build Android
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Fetch Ziran packages
|
|
uses: ./.github/actions/ziran-packages
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '21'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
|
|
- name: Install translation check dependency
|
|
run: sudo apt-get update && sudo apt-get install -y python3-fonttools
|
|
|
|
- name: Cache Android SDK packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ env.ANDROID_HOME }}/platforms/android-36
|
|
${{ env.ANDROID_HOME }}/build-tools/34.0.0
|
|
${{ env.ANDROID_HOME }}/ndk/25.1.8937393
|
|
${{ env.ANDROID_HOME }}/ndk/28.2.13676358
|
|
${{ env.ANDROID_HOME }}/cmake/3.22.1
|
|
key: android-sdk-${{ runner.os }}-${{ runner.arch }}-api36-bt34-ndk25-ndk28-cmake322
|
|
restore-keys: |
|
|
android-sdk-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Cache Android native build
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
droid/app/.cxx
|
|
droid/app/build/intermediates/cxx
|
|
key: android-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('droid/app/src/main/cpp/CMakeLists.txt', 'droid/app/build.gradle', 'src/**/*.c', 'src/**/*.h', 'ziran.lock') }}
|
|
restore-keys: |
|
|
android-native-${{ runner.os }}-${{ runner.arch }}-
|
|
|
|
- name: Install Android SDK Components
|
|
run: |
|
|
set -euo pipefail
|
|
SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
|
|
yes | "$SDKMANAGER" --licenses >/dev/null || true
|
|
"$SDKMANAGER" "platforms;android-36" "build-tools;34.0.0" "ndk;25.1.8937393" "cmake;3.22.1"
|
|
|
|
- name: Prepare Android signing key
|
|
env:
|
|
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p ~/.android
|
|
echo "$KEYSTORE_BASE64" | base64 -d > ~/.android/inbe-release.keystore
|
|
|
|
- name: Prepare Firebase config
|
|
env:
|
|
GOOGLE_SERVICES_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}
|
|
run: ./scripts/write-google-services-json.sh
|
|
|
|
- name: Copy Android Assets
|
|
run: ./scripts/copy-android-assets.sh
|
|
|
|
- name: Build Android APK and AAB
|
|
env:
|
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
|
run: |
|
|
set -euo pipefail
|
|
chmod +x droid/gradlew
|
|
./droid/gradlew -p droid assembleRelease assembleGplay \
|
|
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
|
|
-Pkeystore.alias="$KEY_ALIAS" \
|
|
-Pkeystore.password="$KEYSTORE_PASSWORD" \
|
|
--stacktrace
|
|
./droid/gradlew -p droid bundleGplay \
|
|
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
|
|
-Pkeystore.alias="$KEY_ALIAS" \
|
|
-Pkeystore.password="$KEYSTORE_PASSWORD" \
|
|
--stacktrace
|
|
make android-copy-release-apks
|
|
make android-copy-bundle
|
|
# F-Droid rebuilds the universal APK with -PfDroidBuild and copies
|
|
# this APK's signature onto it, so the two must match byte for byte.
|
|
./droid/gradlew -p droid assembleRelease -PfDroidBuild=true \
|
|
-Pkeystore.path="$HOME/.android/inbe-release.keystore" \
|
|
-Pkeystore.alias="$KEY_ALIAS" \
|
|
-Pkeystore.password="$KEYSTORE_PASSWORD" \
|
|
--stacktrace
|
|
make android-copy-fdroid-apk
|
|
|
|
- name: Preserve Android Native Crash Symbols
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-native-symbols
|
|
path: droid/app/build/intermediates/native_debug_metadata/**/out/**/*.dbg
|
|
if-no-files-found: error
|
|
retention-days: 90
|
|
|
|
- name: Collect Android Release Files
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p build/release/android
|
|
VERSION=$(python3 scripts/check-version.py --print-version)
|
|
if [ -z "$VERSION" ]; then
|
|
echo "Could not read APP_VERSION_STRING"
|
|
exit 1
|
|
fi
|
|
for apk in "build/android/inbe-$VERSION.apk" "build/android/inbe-$VERSION-gplay.apk" \
|
|
"build/android/inbe-$VERSION-fdroid.apk"; do
|
|
if [ ! -f "$apk" ]; then
|
|
echo "Missing universal APK: $apk"
|
|
exit 1
|
|
fi
|
|
cp "$apk" build/release/android/
|
|
done
|
|
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
|
|
apk="build/android/inbe-$VERSION-$abi.apk"
|
|
test -f "$apk"
|
|
cp "$apk" build/release/android/
|
|
done
|
|
cp "build/android/inbe-$VERSION-gplay.aab" build/release/android/
|
|
|
|
- name: Upload Android Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-android
|
|
path: build/release/android/*
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs:
|
|
- build-web
|
|
- build-chrome-extension
|
|
- build-firefox-addons
|
|
- build-linux-appimage
|
|
- build-linux-deb
|
|
- build-linux-rpm
|
|
- build-linux-snap
|
|
- build-linux-flatpak
|
|
- build-windows
|
|
- build-android
|
|
outputs:
|
|
tag_pushed: ${{ steps.tag_version.outputs.tag_pushed }}
|
|
release_upload: ${{ steps.tag_version.outputs.release_upload }}
|
|
tag_name: ${{ steps.tag_version.outputs.tag_name }}
|
|
version: ${{ steps.tag_version.outputs.version }}
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download Release Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: release-*
|
|
path: build/release
|
|
merge-multiple: true
|
|
|
|
- name: Verify Release Artifacts
|
|
run: |
|
|
set -euo pipefail
|
|
test -n "$(find build/release -type f -print -quit)"
|
|
VERSION=$(python3 scripts/check-version.py --print-version)
|
|
if [ -z "$VERSION" ]; then
|
|
echo "Could not read APP_VERSION_STRING"
|
|
exit 1
|
|
fi
|
|
missing=0
|
|
while IFS= read -r file; do
|
|
if [ ! -f "build/release/$file" ]; then
|
|
echo "::error::missing release artifact: $file"
|
|
missing=1
|
|
fi
|
|
done < <(scripts/list-expected-release-assets.sh "$VERSION")
|
|
exit "$missing"
|
|
|
|
- name: Require a Passing Phone Check for a New Version
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION=$(python3 scripts/check-version.py --print-version)
|
|
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
|
echo "v$VERSION is already tagged; no new version to check"
|
|
exit 0
|
|
fi
|
|
python3 scripts/check-phone-check.py "$VERSION"
|
|
|
|
- name: Create and Push Tag If Version Is New
|
|
id: tag_version
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION=$(python3 scripts/check-version.py --print-version)
|
|
if [ -z "$VERSION" ]; then
|
|
echo "Could not read APP_VERSION_STRING"
|
|
exit 1
|
|
fi
|
|
TAG="v$VERSION"
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
echo "tag_name=$TAG" >> "$GITHUB_OUTPUT"
|
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
|
if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
|
|
gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' | sort -u > existing-release-assets.txt
|
|
scripts/list-expected-release-assets.sh "$VERSION" | sort -u > expected-release-assets.txt
|
|
comm -23 expected-release-assets.txt existing-release-assets.txt > missing-release-assets.txt
|
|
if [ -s missing-release-assets.txt ]; then
|
|
echo "Tag $TAG exists; uploading missing GitHub release assets"
|
|
sed 's/^/missing asset: /' missing-release-assets.txt
|
|
echo "release_upload=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "Tag $TAG and its GitHub release already have the expected assets, skipping release upload"
|
|
echo "release_upload=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
echo "tag_pushed=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "Tag $TAG exists but its GitHub release is missing; publishing release"
|
|
echo "tag_pushed=true" >> "$GITHUB_OUTPUT"
|
|
echo "release_upload=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
else
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git tag -a "$TAG" -m "Release $VERSION"
|
|
git push origin "$TAG"
|
|
echo "tag_pushed=true" >> "$GITHUB_OUTPUT"
|
|
echo "release_upload=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Generate Update Appcast
|
|
if: steps.tag_version.outputs.release_upload == 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION='${{ steps.tag_version.outputs.version }}'
|
|
TAG="v$VERSION"
|
|
BASE="https://github.com/waozixyz/inbe/releases/download/$TAG"
|
|
WINZIP="$(find build/release -maxdepth 2 -name '*-windows.zip' -print -quit || true)"
|
|
channels=()
|
|
for appimage in build/release/inbe-linux-*.AppImage; do
|
|
[ -f "$appimage" ] || continue
|
|
case "$(basename "$appimage")" in
|
|
inbe-linux-x86_64.AppImage) channel=appimage-amd64 ;;
|
|
inbe-linux-aarch64.AppImage) channel=appimage-arm64 ;;
|
|
*) channel=appimage-$(basename "$appimage" .AppImage | sed 's/^inbe-linux-//') ;;
|
|
esac
|
|
channels+=("--channel" "$channel=$appimage")
|
|
done
|
|
[ -n "$WINZIP" ] && channels+=("--channel" "windows=$WINZIP")
|
|
for deb in build/release/*.deb; do
|
|
[ -f "$deb" ] || continue
|
|
arch="${deb##*_}"
|
|
arch="${arch%.deb}"
|
|
channels+=("--channel" "deb-$arch=$deb")
|
|
done
|
|
for rpm in build/release/*.rpm; do
|
|
[ -f "$rpm" ] || continue
|
|
arch="${rpm##*.}"
|
|
arch="${arch%.rpm}"
|
|
channels+=("--channel" "rpm-$arch=$rpm")
|
|
done
|
|
# Directly installed APKs update themselves from these channels;
|
|
# the Google Play and F-Droid builds update through their stores.
|
|
while IFS= read -r apk; do
|
|
abi="$(basename "$apk" .apk)"
|
|
abi="${abi#inbe-$VERSION}"
|
|
case "$abi" in
|
|
-gplay|-fdroid) continue ;;
|
|
"") channels+=("--channel" "android=$apk") ;;
|
|
*) channels+=("--channel" "android$abi=$apk") ;;
|
|
esac
|
|
done < <(find build/release -maxdepth 2 -name "inbe-$VERSION*.apk" | sort)
|
|
if [ ${#channels[@]} -eq 0 ]; then
|
|
echo "no release artifacts found for the appcast"
|
|
exit 1
|
|
fi
|
|
python3 scripts/make_appcast.py \
|
|
--version "$VERSION" \
|
|
--base-url "$BASE" \
|
|
--notes-url "https://github.com/waozixyz/inbe/releases/tag/$TAG" \
|
|
--changelog CHANGELOG.md \
|
|
--out build/release/appcast.json \
|
|
"${channels[@]}"
|
|
|
|
- name: Create GitHub Release
|
|
if: steps.tag_version.outputs.release_upload == 'true'
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ steps.tag_version.outputs.tag_name }}
|
|
files: build/release/*
|
|
overwrite_files: true
|
|
generate_release_notes: true
|
|
draft: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
notify-waozi-site:
|
|
name: Notify Waozi devlog
|
|
runs-on: ubuntu-latest
|
|
needs: release
|
|
if: needs.release.outputs.release_upload == 'true'
|
|
steps:
|
|
- name: Trigger Waozi site rebuild
|
|
env:
|
|
WAOZI_SITE_DISPATCH_TOKEN: ${{ secrets.WAOZI_SITE_DISPATCH_TOKEN }}
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${WAOZI_SITE_DISPATCH_TOKEN:-}" ]; then
|
|
echo "::warning::WAOZI_SITE_DISPATCH_TOKEN is not configured; skipping Waozi devlog dispatch"
|
|
exit 0
|
|
fi
|
|
curl -fsS -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $WAOZI_SITE_DISPATCH_TOKEN" \
|
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
https://api.github.com/repos/waozixyz/waozi/dispatches \
|
|
-d "{\"event_type\":\"devlog\",\"client_payload\":{\"project\":\"inbe\",\"version\":\"$VERSION\"}}"
|
|
|
|
publish-itch:
|
|
name: Publish itch.io
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
needs:
|
|
- build-web
|
|
- release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
env:
|
|
BUTLER_API_KEY: ${{ secrets.ITCH_API_KEY }}
|
|
|
|
steps:
|
|
- name: Check itch.io Secret
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${BUTLER_API_KEY:-}" ]; then
|
|
echo "ITCH_API_KEY secret is required to publish itch.io"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download Release Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: release-*
|
|
path: build/release
|
|
merge-multiple: true
|
|
|
|
- name: Install Butler
|
|
timeout-minutes: 15
|
|
run: |
|
|
set -euo pipefail
|
|
.github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt unzip
|
|
curl -fsSL \
|
|
https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default \
|
|
-o "$RUNNER_TEMP/butler.zip"
|
|
mkdir -p "$RUNNER_TEMP/butler"
|
|
unzip -q "$RUNNER_TEMP/butler.zip" -d "$RUNNER_TEMP/butler"
|
|
chmod +x "$RUNNER_TEMP/butler/butler"
|
|
echo "$RUNNER_TEMP/butler" >> "$GITHUB_PATH"
|
|
|
|
- name: Check Butler
|
|
run: |
|
|
set -euo pipefail
|
|
butler version
|
|
|
|
- name: Publish Release Builds to itch.io
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION="${{ needs.release.outputs.version }}"
|
|
|
|
web_zip="build/release/inbe-web.zip"
|
|
android_apk="build/release/inbe-$VERSION.apk"
|
|
windows_zip="build/release/inbe-windows.zip"
|
|
linux_appimage="build/release/inbe-linux-x86_64.AppImage"
|
|
|
|
test -f "$web_zip"
|
|
test -f "$android_apk"
|
|
test -f "$windows_zip"
|
|
test -f "$linux_appimage"
|
|
|
|
mkdir -p build/itch/inbe-web
|
|
unzip -q "$web_zip" -d build/itch/inbe-web
|
|
|
|
butler_push() {
|
|
local target="$1"
|
|
local channel="$2"
|
|
local attempt
|
|
local log_file
|
|
log_file="$(mktemp)"
|
|
|
|
for attempt in 1 2 3 4 5 6; do
|
|
if butler push "$target" "waozi/inbe:$channel" --userversion "$VERSION" 2>&1 | tee "$log_file"; then
|
|
rm -f "$log_file"
|
|
return 0
|
|
fi
|
|
if ! grep -q "latest build is still processing" "$log_file"; then
|
|
rm -f "$log_file"
|
|
return 1
|
|
fi
|
|
echo "itch.io channel $channel is still processing; retrying in 60s ($attempt/6)"
|
|
sleep 60
|
|
done
|
|
|
|
rm -f "$log_file"
|
|
echo "itch.io channel $channel was still processing after retries"
|
|
return 1
|
|
}
|
|
|
|
butler_push build/itch/inbe-web html5
|
|
butler_push "$android_apk" android
|
|
butler_push "$windows_zip" windows
|
|
butler_push "$linux_appimage" linux
|
|
|
|
publish-google-play:
|
|
name: Publish Google Play Production
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
needs:
|
|
- build-android
|
|
- release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
|
|
steps:
|
|
- name: Check Google Play Secret
|
|
env:
|
|
PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${PLAY_STORE_JSON_KEY:-}" ]; then
|
|
echo "PLAY_STORE_JSON_KEY secret is required to publish Google Play"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Download Android Release Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-android
|
|
path: build/release/android
|
|
|
|
- name: Publish AAB to Google Play Production
|
|
uses: r0adkll/upload-google-play@v1
|
|
with:
|
|
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_JSON_KEY }}
|
|
packageName: xyz.waozi.inbe
|
|
releaseFiles: build/release/android/inbe-${{ needs.release.outputs.version }}-gplay.aab
|
|
track: production
|
|
status: completed
|
|
|
|
publish-amazon:
|
|
name: Publish Amazon Appstore
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
needs:
|
|
- build-android
|
|
- release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
env:
|
|
AMAZON_CLIENT_ID: ${{ secrets.AMAZON_CLIENT_ID }}
|
|
AMAZON_CLIENT_SECRET: ${{ secrets.AMAZON_CLIENT_SECRET }}
|
|
AMAZON_APP_ID: ${{ secrets.AMAZON_APP_ID }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check Amazon Appstore Secrets
|
|
id: amazon_secrets
|
|
run: |
|
|
set -euo pipefail
|
|
for name in AMAZON_CLIENT_ID AMAZON_CLIENT_SECRET AMAZON_APP_ID; do
|
|
if [ -z "${!name:-}" ]; then
|
|
echo "::warning::$name secret is not configured; skipping Amazon Appstore publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
done
|
|
echo "configured=true" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Download Android Release Artifact
|
|
if: steps.amazon_secrets.outputs.configured == 'true'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-android
|
|
path: build/release/android
|
|
|
|
- name: Set up Node
|
|
if: steps.amazon_secrets.outputs.configured == 'true'
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Upload APK to Amazon Appstore
|
|
if: steps.amazon_secrets.outputs.configured == 'true'
|
|
env:
|
|
AMAZON_RELEASE_FILE: build/release/android/inbe-${{ needs.release.outputs.version }}.apk
|
|
run: |
|
|
set -euo pipefail
|
|
if ! node scripts/upload-amazon-appstore.mjs; then
|
|
echo "::warning::Amazon Appstore publish failed; release artifacts were still created"
|
|
fi
|
|
|
|
publish-chrome-web-store:
|
|
name: Publish Chrome Web Store
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
needs:
|
|
- build-chrome-extension
|
|
- release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
|
|
steps:
|
|
- name: Check Chrome Web Store Secrets
|
|
id: chrome_secrets
|
|
env:
|
|
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
|
|
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
|
|
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${CHROME_CLIENT_ID:-}" ]; then
|
|
echo "::warning::CHROME_CLIENT_ID secret is not configured; skipping Chrome Web Store publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
if [ -z "${CHROME_CLIENT_SECRET:-}" ]; then
|
|
echo "::warning::CHROME_CLIENT_SECRET secret is not configured; skipping Chrome Web Store publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
if [ -z "${CHROME_REFRESH_TOKEN:-}" ]; then
|
|
echo "::warning::CHROME_REFRESH_TOKEN secret is not configured; skipping Chrome Web Store publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
echo "configured=true" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Download Chrome Extension Artifact
|
|
if: steps.chrome_secrets.outputs.configured == 'true'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-chrome-web-store
|
|
path: build/release/chrome-web-store
|
|
|
|
- name: Publish Chrome Extension
|
|
if: steps.chrome_secrets.outputs.configured == 'true'
|
|
env:
|
|
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
|
|
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
|
|
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
|
CHROME_EXTENSION_ID: lballhghblaenelehneigekpofgcaifa
|
|
CHROME_EXTENSION_ZIP: build/release/chrome-web-store/inbe-chrome-web-store.zip
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
token_response_file="$(mktemp)"
|
|
token_status="$(curl --silent --show-error \
|
|
--request POST \
|
|
--data-urlencode "client_id=${CHROME_CLIENT_ID}" \
|
|
--data-urlencode "client_secret=${CHROME_CLIENT_SECRET}" \
|
|
--data-urlencode "refresh_token=${CHROME_REFRESH_TOKEN}" \
|
|
--data-urlencode "grant_type=refresh_token" \
|
|
--output "$token_response_file" \
|
|
--write-out "%{http_code}" \
|
|
https://oauth2.googleapis.com/token)"
|
|
token_response="$(cat "$token_response_file")"
|
|
rm -f "$token_response_file"
|
|
if [ "$token_status" -lt 200 ] || [ "$token_status" -ge 300 ]; then
|
|
echo "::error::Chrome Web Store token request failed with HTTP $token_status: $token_response"
|
|
exit 1
|
|
fi
|
|
|
|
access_token="$(python3 -c 'import json, sys; print(json.load(sys.stdin)["access_token"])' <<< "$token_response")"
|
|
|
|
upload_response_file="$(mktemp)"
|
|
upload_status="$(curl --silent --show-error \
|
|
--request PUT \
|
|
--header "Authorization: Bearer ${access_token}" \
|
|
--header "x-goog-api-version: 2" \
|
|
--upload-file "${CHROME_EXTENSION_ZIP}" \
|
|
--output "$upload_response_file" \
|
|
--write-out "%{http_code}" \
|
|
"https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_EXTENSION_ID}")"
|
|
upload_response="$(cat "$upload_response_file")"
|
|
rm -f "$upload_response_file"
|
|
if [ "$upload_status" -lt 200 ] || [ "$upload_status" -ge 300 ]; then
|
|
echo "::error::Chrome Web Store upload failed with HTTP $upload_status: $upload_response"
|
|
exit 1
|
|
fi
|
|
|
|
python3 - "$upload_response" <<'PY'
|
|
import json
|
|
import sys
|
|
|
|
response = json.loads(sys.argv[1])
|
|
if response.get("uploadState") != "SUCCESS":
|
|
print(json.dumps(response, indent=2), file=sys.stderr)
|
|
print("::error::Chrome Web Store upload was not accepted")
|
|
raise SystemExit(1)
|
|
PY
|
|
|
|
publish_response_file="$(mktemp)"
|
|
publish_status="$(curl --silent --show-error \
|
|
--request POST \
|
|
--header "Authorization: Bearer ${access_token}" \
|
|
--header "x-goog-api-version: 2" \
|
|
--output "$publish_response_file" \
|
|
--write-out "%{http_code}" \
|
|
"https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_EXTENSION_ID}/publish")"
|
|
publish_response="$(cat "$publish_response_file")"
|
|
rm -f "$publish_response_file"
|
|
if [ "$publish_status" -lt 200 ] || [ "$publish_status" -ge 300 ]; then
|
|
echo "::error::Chrome Web Store publish failed with HTTP $publish_status: $publish_response"
|
|
exit 1
|
|
fi
|
|
|
|
python3 - "$publish_response" <<'PY'
|
|
import json
|
|
import sys
|
|
|
|
response = json.loads(sys.argv[1])
|
|
if "OK" not in response.get("status", []):
|
|
print(json.dumps(response, indent=2), file=sys.stderr)
|
|
print("::error::Chrome Web Store publish was not accepted")
|
|
raise SystemExit(1)
|
|
PY
|
|
|
|
publish-firefox-addons:
|
|
name: Publish Firefox Add-ons
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
needs:
|
|
- build-firefox-addons
|
|
- release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
|
|
steps:
|
|
- name: Check Firefox Add-ons Secrets
|
|
id: firefox_secrets
|
|
env:
|
|
AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }}
|
|
AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${AMO_JWT_ISSUER:-}" ]; then
|
|
echo "::warning::AMO_JWT_ISSUER secret is not configured; skipping Firefox Add-ons publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
if [ -z "${AMO_JWT_SECRET:-}" ]; then
|
|
echo "::warning::AMO_JWT_SECRET secret is not configured; skipping Firefox Add-ons publish"
|
|
echo "configured=false" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
echo "configured=true" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Download Firefox Add-on Artifact
|
|
if: steps.firefox_secrets.outputs.configured == 'true'
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-firefox-addons
|
|
path: build/release/firefox-addons
|
|
|
|
- name: Set up Node
|
|
if: steps.firefox_secrets.outputs.configured == 'true'
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Publish Firefox Add-on
|
|
if: steps.firefox_secrets.outputs.configured == 'true'
|
|
env:
|
|
AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }}
|
|
AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }}
|
|
FIREFOX_ADDON_ZIP: build/release/firefox-addons/inbe-firefox-addons.zip
|
|
run: |
|
|
set -euo pipefail
|
|
test -f "$FIREFOX_ADDON_ZIP"
|
|
mkdir -p build/firefox-addons/source build/firefox-addons/signed
|
|
unzip -q "$FIREFOX_ADDON_ZIP" -d build/firefox-addons/source
|
|
if ! npx --yes web-ext sign \
|
|
--source-dir build/firefox-addons/source \
|
|
--artifacts-dir build/firefox-addons/signed \
|
|
--channel listed \
|
|
--api-key "$AMO_JWT_ISSUER" \
|
|
--api-secret "$AMO_JWT_SECRET"; then
|
|
echo "::warning::Firefox Add-ons publish failed; release artifacts were still created"
|
|
fi
|
|
|
|
publish-winget:
|
|
name: Publish winget manifest
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
continue-on-error: true
|
|
needs: release
|
|
if: needs.release.outputs.tag_pushed == 'true'
|
|
env:
|
|
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
|
|
|
steps:
|
|
- name: Check winget Token
|
|
run: |
|
|
if [ -z "${WINGET_TOKEN:-}" ]; then
|
|
echo "WINGET_TOKEN secret not set; skipping winget manifest update"
|
|
exit 0
|
|
fi
|
|
|
|
- name: Download wingetcreate
|
|
if: env.WINGET_TOKEN != ''
|
|
run: |
|
|
set -euo pipefail
|
|
curl -fsSL \
|
|
https://github.com/russellbanks/wingetcreate/releases/latest/download/wingetcreate-linux-x64.tar.gz \
|
|
-o /tmp/wingetcreate.tar.gz
|
|
tar -xzf /tmp/wingetcreate.tar.gz -C "$HOME"
|
|
chmod +x "$HOME/wingetcreate"
|
|
|
|
- name: Submit winget manifest update
|
|
if: env.WINGET_TOKEN != ''
|
|
run: |
|
|
set -euo pipefail
|
|
VERSION='${{ needs.release.outputs.version }}'
|
|
SETUP_URL="https://github.com/waozixyz/inbe/releases/download/v$VERSION/inbe-windows-setup-$VERSION.exe"
|
|
if ! curl -fsSL -o /dev/null "$SETUP_URL"; then
|
|
echo "::warning::setup exe not published yet; skipping winget update"
|
|
exit 0
|
|
fi
|
|
"$HOME/wingetcreate" update xyz.waozi.inbe \
|
|
--version "$VERSION" \
|
|
--urls "$SETUP_URL#x64" \
|
|
--submit \
|
|
--token "$WINGET_TOKEN"
|