ci: create job package
This commit is contained in:
parent
c50ae77d50
commit
72f711f8e5
|
@ -2,6 +2,7 @@ stages:
|
||||||
- format
|
- format
|
||||||
- build_and_test
|
- build_and_test
|
||||||
- quality
|
- quality
|
||||||
|
- package
|
||||||
|
|
||||||
.env:
|
.env:
|
||||||
image: axiomteam/gecko-ci:v0.0.5
|
image: axiomteam/gecko-ci:v0.0.5
|
||||||
|
@ -44,3 +45,29 @@ audit_dependencies:
|
||||||
script:
|
script:
|
||||||
- cargo deny -V
|
- cargo deny -V
|
||||||
- cargo deny check
|
- cargo deny check
|
||||||
|
|
||||||
|
releases:test:
|
||||||
|
extends: .env
|
||||||
|
stage: package
|
||||||
|
allow_failure: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
when: never
|
||||||
|
- when: manual
|
||||||
|
script:
|
||||||
|
- bash "release/android/build-apk.sh" "$(date +%Y%m%d).$(date +%H%M).$(date +%S)+0"
|
||||||
|
artifacts:
|
||||||
|
paths: &releases_artifacts
|
||||||
|
- work/bin/
|
||||||
|
expire_in: 72h
|
||||||
|
|
||||||
|
releases:x64:
|
||||||
|
extends: .env
|
||||||
|
stage: package
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- bash "release/android/build-apk.sh" "${CI_COMMIT_TAG#v}"
|
||||||
|
artifacts:
|
||||||
|
paths: *releases_artifacts
|
||||||
|
expire_in: 1 mos
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "${1}" ]]; then
|
||||||
|
echo "Fatal: no version given to build script"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
APPNAME="gecko"
|
||||||
|
VERSION=$(awk -F '+' '{ print $1 }' <<<${1})
|
||||||
|
BUILD=$(awk -F '+' '{ print $2 }' <<<${1})
|
||||||
|
ORI_APP="app-release.apk"
|
||||||
|
APK_FILENAME="${APPNAME}-${VERSION}+${BUILD}.apk"
|
||||||
|
|
||||||
|
echo "artifact name: ${APK_FILENAME}"
|
||||||
|
|
||||||
|
## Build Rust dependancies
|
||||||
|
echo "Compile Rust binding..."
|
||||||
|
cargo make
|
||||||
|
|
||||||
|
# Build APK
|
||||||
|
echo "Build APK..."
|
||||||
|
flutter clean
|
||||||
|
flutter build apk --release --build-name $VERSION --build-number $BUILD
|
||||||
|
|
||||||
|
# Create artifacts folder
|
||||||
|
ARTIFACTS_FOLDER="work/bin"
|
||||||
|
mkdir -p ${ARTIFACTS_FOLDER}
|
||||||
|
|
||||||
|
# Move APK in artifacts folder
|
||||||
|
APK_PATH="${ARTIFACTS_FOLDER}/${APK_FILENAME}"
|
||||||
|
mv build/app/outputs/flutter-apk/$ORI_APP "$APK_PATH" || exit 1
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue