CI / build (push) Successful in 1m43s
The web build resolves com.yarnpkg:yarn from GitHub during configuration. A run failed after two minutes with a GitHub read timeout, even though nothing in the commit touched the Wasm target. Run kotlinNodeJsSetup and kotlinYarnSetup during the image warm-up so node and yarn come from the Gradle cache in GRADLE_USER_HOME instead of a fresh GitHub download. Bump the image to audiomanager-client-ci:3.
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
|
|
env:
|
|
# Built by scripts/build-ci-image.sh from ci/Dockerfile.
|
|
CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-client-ci:3
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
container:
|
|
image: gitea.tap-tap.win/taptap/audiomanager-client-ci:3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Test and build
|
|
run: |
|
|
set -euo pipefail
|
|
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
|
gradle \
|
|
:composeApp:desktopTest \
|
|
:composeApp:assembleDebug \
|
|
:composeApp:packageUberJarForCurrentOS \
|
|
:composeApp:wasmJsBrowserDistribution \
|
|
--console=plain
|
|
else
|
|
# The optimized Wasm build is CPU-bound and slow; main/PR builds
|
|
# only need to prove the web target compiles and bundles.
|
|
gradle \
|
|
:composeApp:desktopTest \
|
|
:composeApp:assembleDebug \
|
|
:composeApp:wasmJsBrowserDevelopmentExecutableDistribution \
|
|
--console=plain
|
|
fi
|
|
|
|
- name: Collect artifacts
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p dist
|
|
cp composeApp/build/outputs/apk/debug/composeApp-debug.apk dist/AudioManager.apk
|
|
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
|
cp composeApp/build/compose/jars/*.jar dist/AudioManager-desktop.jar
|
|
(cd composeApp/build/dist/wasmJs/productionExecutable && zip -qr "$GITHUB_WORKSPACE/dist/AudioManager-web.zip" .)
|
|
fi
|
|
|
|
- name: Publish release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: scripts/publish-release.sh dist
|