Port CI from GitLab CI to Forgejo Actions
Some checks failed
ci / changes (push) Successful in 15s
ci / build-update-info (push) Has been skipped
ci / build-app-macos (push) Has been skipped
ci / build-app-windows (push) Has been skipped
ci / build-app-appimage (push) Has been skipped
ci / build-app-android (push) Has been skipped
ci / publish-to-google-play (push) Has been skipped
ci / build-mcu (push) Successful in 7m52s
ci / deploy-beta-firmware (push) Failing after 22s
ci / upload-to-s3 (push) Has been cancelled
ci / publish-to-aur (push) Has been cancelled
ci / build-app-debian (push) Has been cancelled
Some checks failed
ci / changes (push) Successful in 15s
ci / build-update-info (push) Has been skipped
ci / build-app-macos (push) Has been skipped
ci / build-app-windows (push) Has been skipped
ci / build-app-appimage (push) Has been skipped
ci / build-app-android (push) Has been skipped
ci / publish-to-google-play (push) Has been skipped
ci / build-mcu (push) Successful in 7m52s
ci / deploy-beta-firmware (push) Failing after 22s
ci / upload-to-s3 (push) Has been cancelled
ci / publish-to-aur (push) Has been cancelled
ci / build-app-debian (push) Has been cancelled
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b644a23540
commit
42b4ef2ae9
7 changed files with 432 additions and 468 deletions
21
.forgejo/actions/prepare-app/action.yml
Normal file
21
.forgejo/actions/prepare-app/action.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: prepare-app
|
||||
description: Build environment for the Tauri app builds (expects a node bookworm container, env TAG = release tag or empty)
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: bash
|
||||
run: |
|
||||
cp software/buildenvironment/debian.sources /etc/apt/sources.list.d/debian.sources
|
||||
bash software/buildenvironment/prepare.sh
|
||||
. "$HOME/.cargo/env"
|
||||
npm install -g pnpm@12.14.0
|
||||
if [ -n "$TAG" ]; then
|
||||
jq --arg version "${TAG#v}" '.version = $version' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
else
|
||||
jq '.bundle.createUpdaterArtifacts = false' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
fi
|
||||
mkdir -p bin
|
||||
405
.forgejo/workflows/ci.yml
Normal file
405
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
tags: ['**']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
full-app-build:
|
||||
description: Build all app targets (like FULL_APP_BUILD in GitLab)
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
# GitLab used the global pipeline id (last one: 128961); run number continues from there
|
||||
BUILD_OFFSET: '128961'
|
||||
TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: default
|
||||
outputs:
|
||||
mcu: ${{ steps.c.outputs.mcu }}
|
||||
app: ${{ steps.c.outputs.app }}
|
||||
android: ${{ steps.c.outputs.android }}
|
||||
full: ${{ steps.c.outputs.full }}
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: c
|
||||
env:
|
||||
BEFORE: ${{ github.event.before }}
|
||||
FULL: ${{ inputs.full-app-build }}
|
||||
run: |
|
||||
files=$(git diff --name-only "$BEFORE" HEAD 2>/dev/null) || files=ALL
|
||||
[ -n "$TAG" ] && files=ALL
|
||||
chg() { [ "$files" = ALL ] || echo "$files" | grep -Eq "$1"; }
|
||||
echo "mcu=$(chg '^(\.forgejo/|software/MCU/)' && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
||||
echo "app=$(chg '^(\.forgejo/|software/App/|software/buildenvironment/)' && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
||||
echo "android=$(chg '^software/App/SFP-Tool/src-tauri/gen/android/' && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
||||
echo "full=$([ "$FULL" = true ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build-mcu:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.mcu == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: python:3.14
|
||||
steps:
|
||||
- run: apt update && apt install -y nodejs python3-zeroconf git
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
- run: pip install -U platformio esptool
|
||||
- name: Build firmware
|
||||
env:
|
||||
NUMBER: ${{ github.run_number }}
|
||||
run: |
|
||||
echo "#define BUILD_NUMBER $((NUMBER + BUILD_OFFSET))
|
||||
#define BUILD_DATE \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
#define BUILD_BRANCH \"$GITHUB_REF_NAME\"
|
||||
#define BUILD_COMMIT \"$(echo $GITHUB_SHA | cut -c1-8)\"" | tee "software/MCU/SFP Tool/include/buildinfo.h"
|
||||
cd "software/MCU/SFP Tool"
|
||||
pio run
|
||||
esptool --chip esp32s3 merge-bin -o ../../../firmware.bin 0x0000 .pio/build/esp32-s3-devkitc-1/bootloader.bin 0x8000 .pio/build/esp32-s3-devkitc-1/partitions.bin 0x10000 .pio/build/esp32-s3-devkitc-1/firmware.bin
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
path: firmware.bin
|
||||
|
||||
build-update-info:
|
||||
if: github.ref_type == 'tag'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- run: apt update && apt install -y jq
|
||||
- env:
|
||||
NUMBER: ${{ github.run_number }}
|
||||
run: |
|
||||
echo "{
|
||||
\"COMMIT\": \"$(echo $GITHUB_SHA | cut -c1-8)\",
|
||||
\"BUILD_NUMBER\": $((NUMBER + BUILD_OFFSET)),
|
||||
\"VERSION\": \"${TAG#v}\",
|
||||
\"DATE\": \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
}" | tee buildinfo.json
|
||||
jq --arg ver "$TAG" '.version = $ver' software/Firmwareupdater/src/manifest.json > manifest.json
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: update-info
|
||||
path: |
|
||||
buildinfo.json
|
||||
manifest.json
|
||||
|
||||
build-app-windows:
|
||||
needs: changes
|
||||
if: github.ref_type == 'tag' || needs.changes.outputs.full == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: ./.forgejo/actions/prepare-app
|
||||
- env:
|
||||
MINIO_HOST: ${{ secrets.MINIO_HOST }}
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
VITE_GLITCHTIP_DSN: ${{ secrets.VITE_GLITCHTIP_DSN }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
mkdir -p bin/windows/x86_64
|
||||
# Tauri's NSIS template includes Win\RestartManager.nsh, which bookworm's NSIS 3.08 doesn't ship
|
||||
curl -fsSL -o /usr/share/nsis/Include/Win/RestartManager.nsh https://raw.githubusercontent.com/kichik/nsis/v311/Include/Win/RestartManager.nsh
|
||||
cd software/App/SFP-Tool
|
||||
bash scripts/build-transceiver-wasm.sh
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc
|
||||
cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe* ../../../bin/windows/x86_64
|
||||
if [ -n "$TAG" ]; then
|
||||
jq -n \
|
||||
--arg version "${TAG#v}" \
|
||||
--arg pub_date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
--arg url "${MINIO_HOST}/${MINIO_BUCKET}/windows/x86_64/sfp-tool_${TAG#v}_x64-setup.exe" \
|
||||
--arg signature "$(cat ../../../bin/windows/x86_64/sfp-tool_*-setup.exe.sig)" \
|
||||
'{version: $version, notes: "", pub_date: $pub_date, platforms: {"windows-x86_64": {signature: $signature, url: $url}}}' > ../../../bin/windows.json
|
||||
fi
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: bin-windows
|
||||
path: bin/
|
||||
|
||||
build-app-debian:
|
||||
needs: changes
|
||||
if: github.ref_type == 'tag' || needs.changes.outputs.full == 'true' || needs.changes.outputs.app == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: ./.forgejo/actions/prepare-app
|
||||
- env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
VITE_GLITCHTIP_DSN: ${{ secrets.VITE_GLITCHTIP_DSN }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
mkdir -p bin/linux/x86_64
|
||||
cd software/App/SFP-Tool
|
||||
bash scripts/build-transceiver-wasm.sh
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm tauri build --bundles deb
|
||||
cp src-tauri/target/release/bundle/deb/*.deb ../../../bin/linux/x86_64
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: bin-debian
|
||||
path: bin/
|
||||
|
||||
build-app-appimage:
|
||||
needs: changes
|
||||
if: github.ref_type == 'tag' || needs.changes.outputs.full == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: ./.forgejo/actions/prepare-app
|
||||
- env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
VITE_GLITCHTIP_DSN: ${{ secrets.VITE_GLITCHTIP_DSN }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
mkdir -p bin/linux/x86_64
|
||||
cd software/App/SFP-Tool
|
||||
bash scripts/build-transceiver-wasm.sh
|
||||
pnpm install --frozen-lockfile
|
||||
NO_STRIP=true pnpm tauri build --bundles appimage
|
||||
cp src-tauri/target/release/bundle/appimage/*.AppImage ../../../bin/linux/x86_64
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: bin-appimage
|
||||
path: bin/
|
||||
|
||||
build-app-android:
|
||||
needs: changes
|
||||
if: github.ref_type == 'tag' || needs.changes.outputs.full == 'true' || needs.changes.outputs.android == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: ./.forgejo/actions/prepare-app
|
||||
- env:
|
||||
NUMBER: ${{ github.run_number }}
|
||||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
||||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||
VITE_GLITCHTIP_DSN: ${{ secrets.VITE_GLITCHTIP_DSN }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
run: |
|
||||
export PATH=/root/.cargo/bin:$PATH:/root/Android/cmdline-tools/latest/bin:/root/Android/platform-tools
|
||||
export ANDROID_HOME=/root/Android ANDROID_SDK_ROOT=/root/Android
|
||||
bash software/buildenvironment/prepare-android.sh
|
||||
base64 -d <<< "${ANDROID_KEY_BASE64}" > /tmp/upload-keystore.jks
|
||||
if [ -z "$TAG" ]; then
|
||||
export ANDROID_KEY_PASSWORD=$(openssl rand -hex 32)
|
||||
export ANDROID_KEY_ALIAS=upload
|
||||
rm /tmp/upload-keystore.jks
|
||||
keytool -genkeypair -keystore /tmp/upload-keystore.jks \
|
||||
-storepass "$ANDROID_KEY_PASSWORD" -keypass "$ANDROID_KEY_PASSWORD" \
|
||||
-alias upload -keyalg RSA -keysize 2048 -validity 7 \
|
||||
-dname "CN=CI Android Key, OU=Dev, O=Example, L=City, S=State, C=US"
|
||||
fi
|
||||
G=software/App/SFP-Tool/src-tauri/gen/android
|
||||
echo "keyAlias=${ANDROID_KEY_ALIAS}" > $G/keystore.properties
|
||||
echo "password=${ANDROID_KEY_PASSWORD}" >> $G/keystore.properties
|
||||
echo "storeFile=/tmp/upload-keystore.jks" >> $G/keystore.properties
|
||||
jq --arg version "${TAG#v}" --argjson versionCode "$((NUMBER + BUILD_OFFSET))" \
|
||||
'.bundle.android.versionCode = $versionCode | (if $version != "" then .version = $version else . end)' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
. "$HOME/.cargo/env"
|
||||
mkdir -p bin
|
||||
cd software/App/SFP-Tool
|
||||
bash scripts/build-transceiver-wasm.sh
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm tauri android build --aab --apk
|
||||
cp src-tauri/gen/android/app/build/outputs/bundle/universalRelease/*.aab ../../../bin
|
||||
cp src-tauri/gen/android/app/build/outputs/apk/universal/release/*.apk ../../../bin
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: bin-android
|
||||
path: bin/
|
||||
|
||||
# runs on GitHub (needs a macOS runner), the GitHub workflow fetches the source by commit
|
||||
build-app-macos:
|
||||
if: github.ref_type == 'tag'
|
||||
runs-on: default
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
GH_REPO: ${{ secrets.GH_REPO }}
|
||||
MINIO_HOST: ${{ secrets.MINIO_HOST }}
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
run: |
|
||||
set -eu
|
||||
CURL="curl -fsSL --connect-timeout 30 --max-time 300 --retry 6 --retry-delay 20 --retry-all-errors"
|
||||
API="https://api.github.com/repos/$GH_REPO"
|
||||
AUTH="Authorization: Bearer $GH_TOKEN"
|
||||
ACCEPT="Accept: application/vnd.github+json"
|
||||
VERSION="${TAG#v}"
|
||||
WF="$API/actions/workflows/build-macos.yml"
|
||||
# the job id is part of the run name, so a retry of the same commit gets its own run
|
||||
$CURL -H "$AUTH" -H "$ACCEPT" -X POST "$WF/dispatches" \
|
||||
-d "{\"ref\":\"master\",\"inputs\":{\"gitlab_sha\":\"$GITHUB_SHA\",\"gitlab_job_id\":\"$RUN_ID\",\"version\":\"$VERSION\"}}"
|
||||
RUN=""
|
||||
for i in $(seq 1 30); do
|
||||
RUN=$($CURL -H "$AUTH" -H "$ACCEPT" "$WF/runs?event=workflow_dispatch&per_page=20" \
|
||||
| jq -r --arg job "$RUN_ID" '[.workflow_runs[] | select(.display_title | endswith("gitlab-job " + $job))][0].id // empty') || RUN=""
|
||||
[ -n "$RUN" ] && break
|
||||
sleep 10
|
||||
done
|
||||
[ -n "$RUN" ] || { echo "GitHub run not found"; exit 1; }
|
||||
RUN_ID_GH=$RUN
|
||||
echo "GitHub run: https://github.com/$GH_REPO/actions/runs/$RUN_ID_GH"
|
||||
for i in $(seq 1 180); do
|
||||
R=$($CURL -H "$AUTH" -H "$ACCEPT" "$API/actions/runs/$RUN_ID_GH") || { sleep 20; continue; }
|
||||
[ "$(echo "$R" | jq -r .status)" = completed ] && break
|
||||
sleep 20
|
||||
done
|
||||
CONCLUSION=$(echo "$R" | jq -r .conclusion)
|
||||
[ "$CONCLUSION" = success ] || { echo "GitHub build finished with: $CONCLUSION"; exit 1; }
|
||||
ART_URL=$($CURL -H "$AUTH" -H "$ACCEPT" "$API/actions/runs/$RUN_ID_GH/artifacts" \
|
||||
| jq -r '.artifacts[] | select(.name == "macos-universal") | .archive_download_url')
|
||||
$CURL -H "$AUTH" -o macos.zip "$ART_URL"
|
||||
mkdir -p bin/macos/universal
|
||||
unzip -o macos.zip -d bin/macos/universal
|
||||
SIG=$(cat bin/macos/universal/sfp-tool.app.tar.gz.sig)
|
||||
jq -n --arg version "$VERSION" --arg pub_date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
--arg url "${MINIO_HOST}/${MINIO_BUCKET}/macos/universal/sfp-tool.app.tar.gz" --arg signature "$SIG" \
|
||||
'{version: $version, notes: "", pub_date: $pub_date,
|
||||
platforms: {"darwin-aarch64": {signature: $signature, url: $url},
|
||||
"darwin-x86_64": {signature: $signature, url: $url}}}' > bin/darwin.json
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: bin-macos
|
||||
path: bin/
|
||||
|
||||
upload-to-s3:
|
||||
if: github.ref_type == 'tag'
|
||||
needs: [build-mcu, build-update-info, build-app-windows, build-app-debian, build-app-macos]
|
||||
runs-on: default
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
name: update-info
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
pattern: bin-*
|
||||
path: bin
|
||||
merge-multiple: true
|
||||
- env:
|
||||
MINIO_HOST: ${{ secrets.MINIO_HOST }}
|
||||
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
run: |
|
||||
curl -fsSL -o /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x /usr/local/bin/mc
|
||||
mc alias set minio "$MINIO_HOST" "$MINIO_ACCESS_KEY" "$MINIO_SECRET_KEY"
|
||||
mc cp buildinfo.json minio/$MINIO_BUCKET/buildinfo.json
|
||||
mc cp manifest.json minio/$MINIO_BUCKET/manifest.json
|
||||
mc cp firmware.bin minio/$MINIO_BUCKET/firmware.bin
|
||||
mc cp --recursive bin/* minio/$MINIO_BUCKET/
|
||||
|
||||
publish-to-google-play:
|
||||
if: github.ref_type == 'tag'
|
||||
needs: build-app-android
|
||||
runs-on: default
|
||||
container:
|
||||
image: ruby:3.4.12-trixie
|
||||
steps:
|
||||
- run: apt update && apt install -y nodejs
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
name: bin-android
|
||||
path: bin
|
||||
- env:
|
||||
GOOGLEPLAY_SERVICEACCOUNT: ${{ secrets.GOOGLEPLAY_SERVICEACCOUNT }}
|
||||
run: |
|
||||
bundle install
|
||||
echo "$GOOGLEPLAY_SERVICEACCOUNT" | base64 -d > sfp-tool-1af4237185da.json
|
||||
bundle exec fastlane deploy
|
||||
|
||||
publish-to-aur:
|
||||
if: github.ref_type == 'tag'
|
||||
needs: [build-app-debian, upload-to-s3]
|
||||
runs-on: default
|
||||
container:
|
||||
image: archlinux:base-devel
|
||||
steps:
|
||||
- run: pacman -Syu --noconfirm --needed git openssh python nodejs
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
name: bin-debian
|
||||
path: bin
|
||||
- env:
|
||||
CI_COMMIT_TAG: ${{ github.ref_name }}
|
||||
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
run: bash packaging/aur/publish.sh
|
||||
|
||||
deploy-beta-firmware:
|
||||
needs: [changes, build-mcu]
|
||||
if: github.ref_name == github.event.repository.default_branch && github.ref_type == 'branch' && needs.changes.outputs.mcu == 'true'
|
||||
runs-on: default
|
||||
container:
|
||||
image: node:26.13.1-bookworm
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
- env:
|
||||
NUMBER: ${{ github.run_number }}
|
||||
MINIO_HOST: ${{ secrets.MINIO_HOST }}
|
||||
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
||||
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
run: |
|
||||
apt update && apt install -y jq
|
||||
echo "{
|
||||
\"COMMIT\": \"$(echo $GITHUB_SHA | cut -c1-8)\",
|
||||
\"BUILD_NUMBER\": $((NUMBER + BUILD_OFFSET)),
|
||||
\"VERSION\": \"1.0\",
|
||||
\"DATE\": \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
}" | tee beta-buildinfo.json
|
||||
jq '.version = "1.0"' software/Firmwareupdater/src/manifest.json > beta-manifest.json
|
||||
curl -fsSL -o /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x /usr/local/bin/mc
|
||||
mc alias set minio "$MINIO_HOST" "$MINIO_ACCESS_KEY" "$MINIO_SECRET_KEY"
|
||||
mc cp beta-buildinfo.json minio/$MINIO_BUCKET/beta/buildinfo.json
|
||||
mc cp beta-manifest.json minio/$MINIO_BUCKET/beta/manifest.json
|
||||
mc cp firmware.bin minio/$MINIO_BUCKET/beta/firmware.bin
|
||||
462
.gitlab-ci.yml
462
.gitlab-ci.yml
|
|
@ -1,462 +0,0 @@
|
|||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
build-mcu:
|
||||
stage: build
|
||||
image: python:3.14
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- changes:
|
||||
- .gitlab-ci.yml
|
||||
- software/MCU/**/*
|
||||
before_script:
|
||||
- apt update
|
||||
- apt install -y python3-zeroconf git
|
||||
- pip install -U platformio
|
||||
script:
|
||||
- |
|
||||
echo "#define BUILD_NUMBER $CI_PIPELINE_ID
|
||||
#define BUILD_DATE \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
#define BUILD_BRANCH \"$CI_COMMIT_REF_NAME\"
|
||||
#define BUILD_COMMIT \"$(echo $CI_COMMIT_SHA| cut -c1-8)\"" | tee "software/MCU/SFP Tool/include/buildinfo.h"
|
||||
|
||||
- cd "software/MCU/SFP Tool"
|
||||
- pio run
|
||||
- pip3 install esptool
|
||||
- esptool --chip esp32s3 merge-bin -o ../../../firmware.bin 0x0000 .pio/build/esp32-s3-devkitc-1/bootloader.bin 0x8000 .pio/build/esp32-s3-devkitc-1/partitions.bin 0x10000 .pio/build/esp32-s3-devkitc-1/firmware.bin
|
||||
artifacts:
|
||||
paths:
|
||||
- firmware.bin
|
||||
|
||||
pages:
|
||||
stage: build
|
||||
image: node:26.13.1-bookworm
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- changes:
|
||||
- docs/**/*
|
||||
- software/Firmwareupdater/**/*
|
||||
- software/buildenvironment/**/*
|
||||
- .gitlab-ci.yml
|
||||
before_script:
|
||||
- mkdir -p public/updater
|
||||
- apt update
|
||||
- apt install -y pandoc wkhtmltopdf
|
||||
- npm install -g pnpm@12.14.0
|
||||
script:
|
||||
- cd software/Firmwareupdater
|
||||
- pnpm install --frozen-lockfile --store-dir "$CI_PROJECT_DIR/.pnpm-store"
|
||||
- pnpm build
|
||||
- cp -r dist/* ../../public/updater/
|
||||
- cd ../..
|
||||
- bash docs/build-docs.sh public
|
||||
pages: true
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
||||
build-update-info:
|
||||
stage: build
|
||||
image: alpine:3.24.4
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
before_script:
|
||||
- apk add --no-cache jq
|
||||
script:
|
||||
- |
|
||||
echo "{
|
||||
\"COMMIT\": \"$(echo $CI_COMMIT_SHA| cut -c1-8)\",
|
||||
\"BUILD_NUMBER\": $CI_PIPELINE_ID,
|
||||
\"VERSION\": \"${CI_COMMIT_TAG#v}\",
|
||||
\"DATE\": \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
}" | tee buildinfo.json
|
||||
- jq --arg ver "$CI_COMMIT_REF_NAME" '.version = $ver' software/Firmwareupdater/src/manifest.json > manifest.json
|
||||
artifacts:
|
||||
paths:
|
||||
- buildinfo.json
|
||||
- manifest.json
|
||||
|
||||
.app-build-base:
|
||||
stage: build
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: '$FULL_APP_BUILD == "true"'
|
||||
- changes:
|
||||
- software/App/**/*
|
||||
- software/buildenvironment/**/*
|
||||
- .gitlab-ci.yml
|
||||
- when: never
|
||||
cache:
|
||||
- key:
|
||||
files:
|
||||
- software/App/SFP-Tool/pnpm-lock.yaml
|
||||
paths:
|
||||
- .pnpm-store
|
||||
- key:
|
||||
files:
|
||||
- software/App/SFP-Tool/src-tauri/Cargo.lock
|
||||
prefix: $CI_JOB_NAME
|
||||
paths:
|
||||
- software/App/SFP-Tool/src-tauri/target
|
||||
- key:
|
||||
files:
|
||||
- external/TransceiverTool/conanfile.py
|
||||
prefix: wasm-$CI_JOB_NAME
|
||||
paths:
|
||||
- external/TransceiverTool/build-wasm
|
||||
before_script:
|
||||
- cp software/buildenvironment/debian.sources /etc/apt/sources.list.d/debian.sources
|
||||
- bash software/buildenvironment/prepare.sh
|
||||
- . "$HOME/.cargo/env"
|
||||
- npm install -g pnpm@12.14.0
|
||||
- |
|
||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||
jq --arg version "${CI_COMMIT_TAG#v}" \
|
||||
'.version = $version' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
else
|
||||
jq \
|
||||
'.bundle.createUpdaterArtifacts = false' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
echo "CI_COMMIT_TAG not set, skipping version update"
|
||||
fi
|
||||
- mkdir -p bin
|
||||
|
||||
build-app-windows:
|
||||
extends: .app-build-base
|
||||
image: node:26.13.1-bookworm
|
||||
resource_group: tauri-build-windows
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: '$FULL_APP_BUILD == "true"'
|
||||
- when: never
|
||||
before_script:
|
||||
- !reference [.app-build-base, before_script]
|
||||
- mkdir -p bin/windows/x86_64
|
||||
- mkdir -p bin/linux/x86_64
|
||||
# Tauri's NSIS template includes Win\RestartManager.nsh, which bookworm's NSIS 3.08 doesn't ship
|
||||
- curl -fsSL -o /usr/share/nsis/Include/Win/RestartManager.nsh https://raw.githubusercontent.com/kichik/nsis/v311/Include/Win/RestartManager.nsh
|
||||
script:
|
||||
- cd software/App/SFP-Tool
|
||||
- bash scripts/build-transceiver-wasm.sh
|
||||
- pnpm install --frozen-lockfile --store-dir "$CI_PROJECT_DIR/.pnpm-store"
|
||||
- pnpm tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc
|
||||
- cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe* ../../../bin/windows/x86_64
|
||||
- |
|
||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||
jq -n \
|
||||
--arg version "${CI_COMMIT_TAG#v}" \
|
||||
--arg pub_date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
--arg url "${MINIO_HOST}/${MINIO_BUCKET}/windows/x86_64/sfp-tool_${CI_COMMIT_TAG#v}_x64-setup.exe" \
|
||||
--arg signature "$(cat ../../../bin/windows/x86_64/sfp-tool_*-setup.exe.sig)" \
|
||||
'
|
||||
{
|
||||
version: $version,
|
||||
notes: "",
|
||||
pub_date: $pub_date,
|
||||
platforms: {
|
||||
"windows-x86_64": {
|
||||
signature: $signature,
|
||||
url: $url
|
||||
}
|
||||
}
|
||||
}
|
||||
' > ../../../bin/windows.json
|
||||
fi
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
|
||||
build-app-debian:
|
||||
extends: .app-build-base
|
||||
image: node:26.13.1-bookworm
|
||||
resource_group: tauri-build-debian
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: '$FULL_APP_BUILD == "true"'
|
||||
- changes:
|
||||
- software/App/**/*
|
||||
- software/buildenvironment/**/*
|
||||
- .gitlab-ci.yml
|
||||
- when: never
|
||||
before_script:
|
||||
- !reference [.app-build-base, before_script]
|
||||
- mkdir -p bin/linux/x86_64
|
||||
script:
|
||||
- cd software/App/SFP-Tool
|
||||
- bash scripts/build-transceiver-wasm.sh
|
||||
- pnpm install --frozen-lockfile --store-dir "$CI_PROJECT_DIR/.pnpm-store"
|
||||
- pnpm tauri build --bundles deb
|
||||
- cp src-tauri/target/release/bundle/deb/*.deb ../../../bin/linux/x86_64
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
|
||||
# build-app-debian-arm64:
|
||||
# extends: .app-build-base
|
||||
# needs: [ prepare-build-container ]
|
||||
# image: $CI_REGISTRY_IMAGE/build-context:$CI_COMMIT_SHA
|
||||
# before_script:
|
||||
# - !reference [ .app-build-base, before_script ]
|
||||
# - mkdir -p bin/linux/arm64
|
||||
# script:
|
||||
# - cd software/App/SFP-Tool
|
||||
# - bash scripts/build-transceiver-wasm.sh
|
||||
# - pnpm install
|
||||
# - export PKG_CONFIG_ALLOW_CROSS=1
|
||||
# - export PKG_CONFIG_SYSROOT_DIR="${AARCH64_SYSROOT}"
|
||||
# - export PKG_CONFIG_LIBDIR="${AARCH64_SYSROOT}/usr/lib/aarch64-linux-gnu/pkgconfig:${AARCH64_SYSROOT}/usr/lib/pkgconfig:${AARCH64_SYSROOT}/usr/share/pkgconfig"
|
||||
# - export PKG_CONFIG_PATH="${PKG_CONFIG_LIBDIR}"
|
||||
# - export CFLAGS_aarch64_unknown_linux_gnu="--sysroot=${AARCH64_SYSROOT}"
|
||||
# - export CXXFLAGS_aarch64_unknown_linux_gnu="--sysroot=${AARCH64_SYSROOT}"
|
||||
# - export RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc -C link-arg=--sysroot=${AARCH64_SYSROOT}"
|
||||
# - pnpm tauri build --bundles deb --target aarch64-unknown-linux-gnu
|
||||
# - cp src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb ../../../bin/linux/arm64
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - bin/
|
||||
|
||||
build-app-appimage:
|
||||
extends: .app-build-base
|
||||
image: node:26.13.1-bookworm
|
||||
resource_group: tauri-build-appimage
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: '$FULL_APP_BUILD == "true"'
|
||||
- when: never
|
||||
before_script:
|
||||
- !reference [.app-build-base, before_script]
|
||||
- mkdir -p bin/windows/x86_64
|
||||
- mkdir -p bin/linux/x86_64
|
||||
script:
|
||||
- cd software/App/SFP-Tool
|
||||
- bash scripts/build-transceiver-wasm.sh
|
||||
- pnpm install --frozen-lockfile --store-dir "$CI_PROJECT_DIR/.pnpm-store"
|
||||
- NO_STRIP=true pnpm tauri build --bundles appimage
|
||||
- cp src-tauri/target/release/bundle/appimage/*.AppImage ../../../bin/linux/x86_64
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
|
||||
build-app-android:
|
||||
extends: .app-build-base
|
||||
image: node:26.13.1-bookworm
|
||||
resource_group: tauri-build-android
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: '$FULL_APP_BUILD == "true"'
|
||||
- changes:
|
||||
- software/App/SFP-Tool/src-tauri/gen/android/**/*
|
||||
- when: never
|
||||
before_script:
|
||||
- export PATH=/root/.cargo/bin:$PATH:/root/Android/cmdline-tools/latest/bin:/root/Android/platform-tools
|
||||
- export ANDROID_HOME=/root/Android
|
||||
- export ANDROID_SDK_ROOT=/root/Android
|
||||
- !reference [.app-build-base, before_script]
|
||||
- bash software/buildenvironment/prepare-android.sh
|
||||
- base64 -d <<< "${ANDROID_KEY_BASE64}" > /tmp/upload-keystore.jks
|
||||
- |
|
||||
if [ -z "$CI_COMMIT_TAG" ]; then
|
||||
export ANDROID_KEY_PASSWORD=$(openssl rand -hex 32)
|
||||
export ANDROID_KEY_ALIAS=upload
|
||||
rm /tmp/upload-keystore.jks
|
||||
keytool -genkeypair \
|
||||
-keystore /tmp/upload-keystore.jks \
|
||||
-storepass "$ANDROID_KEY_PASSWORD" \
|
||||
-keypass "$ANDROID_KEY_PASSWORD" \
|
||||
-alias "upload" \
|
||||
-keyalg RSA \
|
||||
-keysize 2048 \
|
||||
-validity "7" \
|
||||
-dname "CN=CI Android Key, OU=Dev, O=Example, L=City, S=State, C=US"
|
||||
fi
|
||||
- |
|
||||
echo "keyAlias=${ANDROID_KEY_ALIAS}" > software/App/SFP-Tool/src-tauri/gen/android/keystore.properties
|
||||
echo "password=${ANDROID_KEY_PASSWORD}" >> software/App/SFP-Tool/src-tauri/gen/android/keystore.properties
|
||||
echo "storeFile=/tmp/upload-keystore.jks" >> software/App/SFP-Tool/src-tauri/gen/android/keystore.properties
|
||||
- |
|
||||
jq \
|
||||
--arg version "${CI_COMMIT_TAG#v}" \
|
||||
--argjson versionCode "$CI_PIPELINE_ID" \
|
||||
'
|
||||
.bundle.android.versionCode = $versionCode
|
||||
| (if $version != "" then .version = $version else . end)
|
||||
' \
|
||||
software/App/SFP-Tool/src-tauri/tauri.conf.json > tauri.conf.json.tmp \
|
||||
&& mv tauri.conf.json.tmp software/App/SFP-Tool/src-tauri/tauri.conf.json
|
||||
|
||||
script:
|
||||
- cd software/App/SFP-Tool
|
||||
- bash scripts/build-transceiver-wasm.sh
|
||||
- pnpm install --frozen-lockfile --store-dir "$CI_PROJECT_DIR/.pnpm-store"
|
||||
- pnpm tauri android build --aab --apk
|
||||
- cp src-tauri/gen/android/app/build/outputs/bundle/universalRelease/*.aab ../../../bin
|
||||
- cp src-tauri/gen/android/app/build/outputs/apk/universal/release/*.apk ../../../bin
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
|
||||
build-app-macos:
|
||||
stage: build
|
||||
image: alpine:3.24.4
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- when: manual
|
||||
allow_failure: true
|
||||
timeout: 2h
|
||||
before_script:
|
||||
- apk add --no-cache curl jq unzip
|
||||
script:
|
||||
- |
|
||||
set -eu
|
||||
# Retry transient GitHub/network failures (connect timeouts, 5xx, 429).
|
||||
CURL="curl -fsSL --connect-timeout 30 --max-time 300 --retry 6 --retry-delay 20 --retry-all-errors"
|
||||
API="https://api.github.com/repos/$GITHUB_REPO"
|
||||
AUTH="Authorization: Bearer $GITHUB_TOKEN"
|
||||
ACCEPT="Accept: application/vnd.github+json"
|
||||
if [ -n "${CI_COMMIT_TAG:-}" ]; then
|
||||
VERSION="${CI_COMMIT_TAG#v}"
|
||||
else
|
||||
VERSION="0.0.0-$CI_COMMIT_SHORT_SHA"
|
||||
fi
|
||||
WF="$API/actions/workflows/build-macos.yml"
|
||||
# The GitLab job id is in the run name, so a retry of the same commit gets its own run
|
||||
$CURL -H "$AUTH" -H "$ACCEPT" -X POST "$WF/dispatches" \
|
||||
-d "{\"ref\":\"master\",\"inputs\":{\"gitlab_sha\":\"$CI_COMMIT_SHA\",\"gitlab_job_id\":\"$CI_JOB_ID\",\"version\":\"$VERSION\"}}"
|
||||
RUN_ID=""
|
||||
for i in $(seq 1 30); do
|
||||
RUN_ID=$($CURL -H "$AUTH" -H "$ACCEPT" "$WF/runs?event=workflow_dispatch&per_page=20" \
|
||||
| jq -r --arg job "$CI_JOB_ID" '[.workflow_runs[] | select(.display_title | endswith("gitlab-job " + $job))][0].id // empty') || RUN_ID=""
|
||||
[ -n "$RUN_ID" ] && break
|
||||
sleep 10
|
||||
done
|
||||
[ -n "$RUN_ID" ] || { echo "GitHub run not found"; exit 1; }
|
||||
echo "GitHub run: https://github.com/$GITHUB_REPO/actions/runs/$RUN_ID"
|
||||
for i in $(seq 1 180); do
|
||||
RUN=$($CURL -H "$AUTH" -H "$ACCEPT" "$API/actions/runs/$RUN_ID") || { sleep 20; continue; }
|
||||
[ "$(echo "$RUN" | jq -r .status)" = completed ] && break
|
||||
sleep 20
|
||||
done
|
||||
CONCLUSION=$(echo "$RUN" | jq -r .conclusion)
|
||||
[ "$CONCLUSION" = success ] || { echo "GitHub build finished with: $CONCLUSION"; exit 1; }
|
||||
ART_URL=$($CURL -H "$AUTH" -H "$ACCEPT" "$API/actions/runs/$RUN_ID/artifacts" \
|
||||
| jq -r '.artifacts[] | select(.name == "macos-universal") | .archive_download_url')
|
||||
$CURL -H "$AUTH" -o macos.zip "$ART_URL"
|
||||
mkdir -p bin/macos/universal
|
||||
unzip -o macos.zip -d bin/macos/universal
|
||||
if [ -n "${CI_COMMIT_TAG:-}" ]; then
|
||||
SIG=$(cat bin/macos/universal/sfp-tool.app.tar.gz.sig)
|
||||
jq -n \
|
||||
--arg version "$VERSION" \
|
||||
--arg pub_date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
--arg url "${MINIO_HOST}/${MINIO_BUCKET}/macos/universal/sfp-tool.app.tar.gz" \
|
||||
--arg signature "$SIG" \
|
||||
'{version: $version, notes: "", pub_date: $pub_date,
|
||||
platforms: {"darwin-aarch64": {signature: $signature, url: $url},
|
||||
"darwin-x86_64": {signature: $signature, url: $url}}}' > bin/darwin.json
|
||||
fi
|
||||
artifacts:
|
||||
paths:
|
||||
- bin/
|
||||
|
||||
upload-to-s3:
|
||||
stage: deploy
|
||||
image:
|
||||
name: minio/mc
|
||||
entrypoint: [""]
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
before_script:
|
||||
- mc alias set minio $MINIO_HOST $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
|
||||
script:
|
||||
- mc cp buildinfo.json minio/$MINIO_BUCKET/buildinfo.json
|
||||
- mc cp manifest.json minio/$MINIO_BUCKET/manifest.json
|
||||
- mc cp firmware.bin minio/$MINIO_BUCKET/firmware.bin
|
||||
- mc cp --recursive bin/* minio/$MINIO_BUCKET/
|
||||
|
||||
dependencies:
|
||||
- build-mcu
|
||||
- build-update-info
|
||||
- build-app-windows
|
||||
- build-app-debian
|
||||
- build-app-macos
|
||||
# - build-app-debian-arm64
|
||||
|
||||
publish-to-google-play:
|
||||
stage: deploy
|
||||
image: ruby:3.4.12-trixie
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
before_script:
|
||||
- bundle install
|
||||
- echo $GOOGLEPLAY_SERVICEACCOUNT | base64 -d > sfp-tool-1af4237185da.json
|
||||
script:
|
||||
- bundle exec fastlane deploy
|
||||
dependencies:
|
||||
- build-app-android
|
||||
|
||||
publish-to-aur:
|
||||
stage: deploy
|
||||
image: archlinux:base-devel
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
needs:
|
||||
- job: build-app-debian
|
||||
artifacts: true
|
||||
- job: upload-to-s3
|
||||
before_script:
|
||||
- pacman -Syu --noconfirm --needed git openssh python
|
||||
script:
|
||||
- bash packaging/aur/publish.sh
|
||||
dependencies:
|
||||
- build-app-debian
|
||||
|
||||
build-beta-info:
|
||||
stage: build
|
||||
image: alpine:3.24.4
|
||||
rules:
|
||||
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
||||
changes:
|
||||
- .gitlab-ci.yml
|
||||
- software/MCU/**/*
|
||||
- when: never
|
||||
before_script:
|
||||
- apk add --no-cache jq
|
||||
script:
|
||||
- |
|
||||
echo "{
|
||||
\"COMMIT\": \"$(echo $CI_COMMIT_SHA| cut -c1-8)\",
|
||||
\"BUILD_NUMBER\": $CI_PIPELINE_ID,
|
||||
\"VERSION\": \"1.0\",
|
||||
\"DATE\": \"$(date '+%Y-%m-%d %H:%M:%S')\"
|
||||
}" | tee beta-buildinfo.json
|
||||
- jq '.version = "1.0"' software/Firmwareupdater/src/manifest.json > beta-manifest.json
|
||||
artifacts:
|
||||
paths:
|
||||
- beta-buildinfo.json
|
||||
- beta-manifest.json
|
||||
|
||||
deploy-beta-firmware:
|
||||
stage: deploy
|
||||
image:
|
||||
name: minio/mc
|
||||
entrypoint: [""]
|
||||
rules:
|
||||
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
||||
changes:
|
||||
- .gitlab-ci.yml
|
||||
- software/MCU/**/*
|
||||
- when: never
|
||||
needs:
|
||||
- job: build-mcu
|
||||
artifacts: true
|
||||
- job: build-beta-info
|
||||
artifacts: true
|
||||
before_script:
|
||||
- mc alias set minio $MINIO_HOST $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
|
||||
script:
|
||||
- mc cp beta-buildinfo.json minio/$MINIO_BUCKET/beta/buildinfo.json
|
||||
- mc cp beta-manifest.json minio/$MINIO_BUCKET/beta/manifest.json
|
||||
- mc cp firmware.bin minio/$MINIO_BUCKET/beta/firmware.bin
|
||||
|
|
@ -34,7 +34,7 @@ There is a mobile and a desktop version available for the following Plattforms:
|
|||
- macOS (Apple Silicon and Intel, universal): https://s3.jonasled.de/sfp-tool/macos/universal/sfp-tool.app.tar.gz (extract and move `sfp-tool.app` into `/Applications`)
|
||||
- Arch Linux: AUR packages `sfptool` (source build for `x86_64` and `aarch64`) and `sfptool-bin` (prebuilt `x86_64` package): https://aur.archlinux.org/packages/sfptool and https://aur.archlinux.org/packages/sfptool-bin
|
||||
|
||||
Android APK/AAB builds and the latest CI artifacts are also available from the GitLab pipelines: https://jonasled.dev/jonasled/sfp-tool/-/pipelines
|
||||
Android APK/AAB builds and the latest CI artifacts are also available from the Forgejo Actions runs: https://forgejo.jonasled.dev/jonasled/sfp-tool/actions
|
||||
|
||||
In theory the app can be build for all major platforms. The macOS build is not signed with an Apple developer license (that requires a yearly subscription), so Gatekeeper may block the first launch; open it via right-click, Open. The application itself is a React app, which runs on Tauri for cross compiling. It connects via BLE to the ESP ans allows controlling the device. There is no difference in features between the desktop and the mobile version.
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ SFP Tool combines portable hardware, embedded firmware, a cross-platform control
|
|||
- Firmware (beta): [firmware.bin](https://s3.jonasled.de/sfp-tool/beta/firmware.bin)
|
||||
- Web firmware updater: [sfp-tool-ae2df9.jonasled.dev](https://sfp-tool-ae2df9.jonasled.dev/)
|
||||
|
||||
Replace `<version>` with the release number, for example `0.1.1`. Every tagged build and its CI artifacts are listed under the [GitLab pipelines](https://jonasled.dev/jonasled/sfp-tool/-/pipelines).
|
||||
Replace `<version>` with the release number, for example `0.1.1`. Every tagged build and its CI artifacts are listed under the [Forgejo Actions runs](https://forgejo.jonasled.dev/jonasled/sfp-tool/actions).
|
||||
|
||||
## Scope
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
# AUR Publishing
|
||||
|
||||
Tagged GitLab pipelines publish two AUR packages:
|
||||
Tagged Forgejo Actions runs publish two AUR packages:
|
||||
|
||||
- `sfptool`: builds the desktop application from source for `x86_64` and `aarch64`
|
||||
- `sfptool-bin`: repackages the released Debian bundle for `x86_64`
|
||||
|
||||
## CI requirements
|
||||
|
||||
Set `AUR_SSH_PRIVATE_KEY` in GitLab CI. The key must have push access to both:
|
||||
Set `AUR_SSH_PRIVATE_KEY` as a Forgejo Actions secret. The key must have push access to both:
|
||||
|
||||
- `ssh://aur@aur.archlinux.org/sfptool.git`
|
||||
- `ssh://aur@aur.archlinux.org/sfptool-bin.git`
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ for pkg in sfptool sfptool-bin; do
|
|||
if [ -z \"\$(git status --porcelain)\" ]; then
|
||||
exit 0
|
||||
fi
|
||||
git config user.name 'GitLab CI'
|
||||
git config user.name 'Forgejo CI'
|
||||
git config user.email 'ci@jonasled.dev'
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m 'Update to ${version}'
|
||||
|
|
@ -61,7 +61,7 @@ for pkg in sfptool sfptool-bin; do
|
|||
if [ -z "$(git status --porcelain)" ]; then
|
||||
exit 0
|
||||
fi
|
||||
git config user.name "GitLab CI"
|
||||
git config user.name "Forgejo CI"
|
||||
git config user.email "ci@jonasled.dev"
|
||||
git add PKGBUILD .SRCINFO
|
||||
git commit -m "Update to ${version}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue