add gitlab ci
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
stages:
|
||||
- prepare
|
||||
- build
|
||||
|
||||
default:
|
||||
image: golang:1.25.9-trixie # according to the original ~1.25.7
|
||||
|
||||
calculate-version:
|
||||
stage: prepare
|
||||
script:
|
||||
- go run -v ./cmd/internal/read_tag --ci --nightly
|
||||
- echo "version=$version" >> artifact.env
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: artifact.env
|
||||
|
||||
build-android:
|
||||
stage: build
|
||||
before_script: |
|
||||
sudo apt update && sudo apt install -y openjdk-17-jdk-headless
|
||||
/usr/lib/jvm/java-17-openjdk-amd64/bin/java --version
|
||||
script:
|
||||
- bash ./setup-ndk.sh
|
||||
- git submodule update --init --recursive
|
||||
- git ls-remote --exit-code --tags origin v$version || echo "PUBLISHED=false" >> "$GITHUB_ENV"
|
||||
- git tag v$version -f
|
||||
- make lib_install
|
||||
- export PATH="$PATH:$(go env GOPATH)/bin"
|
||||
- make lib_android
|
||||
- cd clients/android && git checkout dev && cd ../..
|
||||
- go run -v ./cmd/internal/update_android_version --ci --nightly
|
||||
- mkdir clients/android/app/libs # start building
|
||||
- cp *.aar clients/android/app/libs
|
||||
- cd clients/android
|
||||
- ./gradlew :app:assembleOtherRelease :app:assembleOtherLegacyRelease
|
||||
- cd ../..
|
||||
- mkdir -p dist # prepare upload
|
||||
- cp clients/android/app/build/outputs/apk/other/release/*.apk dist
|
||||
- cp clients/android/app/build/outputs/apk/otherLegacy/release/*.apk dist
|
||||
- VERSION_CODE=$(grep VERSION_CODE clients/android/version.properties | cut -d= -f2)
|
||||
- VERSION_NAME=$(grep VERSION_NAME clients/android/version.properties | cut -d= -f2)
|
||||
variables:
|
||||
ANDROID_NDK_VERSION: r28
|
||||
LOCAL_PROPERTIES: "S0VZU1RPUkVfUEFTUz0xMTQ1MTQKQUxJQVNfTkFNRT1hbGlhcwpBTElBU19QQVNTPTExNDUxNAo="
|
||||
artifacts:
|
||||
paths:
|
||||
- "./dist"
|
||||
Reference in New Issue
Block a user