This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
stages: | ||
- build | ||
- push | ||
- release | ||
- deploy | ||
cache: | ||
key: ${CI_PROJECT_ID} | ||
paths: | ||
|
@@ -12,41 +11,37 @@ variables: | |
REPO: telegram-sms-china | ||
KEYSTORE_SERVER: keystore.git.reallct.uk | ||
|
||
release_github: | ||
stage: push | ||
release:master: | ||
dependencies: | ||
- build | ||
stage: deploy | ||
only: | ||
- master | ||
script: | ||
- eval $(ssh-agent -s) | ||
- ssh-add - <<< $(curl https://${KEYSTORE_SERVER}/gitlab-sshkey/id_ecdsa -u gitlab:${key_store_passwd}) | ||
- git push --set-upstream [email protected]:${OWNER}/${REPO}.git HEAD:refs/heads/${CI_COMMIT_REF_NAME} | ||
|
||
release_nightly_github: | ||
stage: push | ||
only: | ||
- nightly | ||
script: | ||
- eval $(ssh-agent -s) | ||
- ssh-add - <<< $(curl https://${KEYSTORE_SERVER}/gitlab-sshkey/id_ecdsa -u gitlab:${key_store_passwd}) | ||
- git push --set-upstream [email protected]:${OWNER}/${REPO}.git HEAD:refs/heads/${CI_COMMIT_REF_NAME} | ||
- apk --update --no-cache add git openssl bash curl wget go | ||
- go get -u -v github.com/tcnksm/ghr | ||
- curl https://${KEYSTORE_SERVER}/gitlab-sshkey/github-key.env -o .reall_network/github-key.env -u gitlab:${key_store_passwd} | ||
- . .reall_network/github-key.env | ||
- git push --set-upstream https://${GITHUB_ACCESS_KEY}@github.com/${OWNER}/${REPO}.git HEAD:refs/heads/${CI_COMMIT_REF_NAME} | ||
- /root/go/bin/ghr -t "${GITHUB_ACCESS_KEY}" -u "${OWNER}" -r "${REPO}" "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}-$(date "+%Y%m%d%H%M")" "./app/build/outputs/apk/release/app-release.apk" | ||
|
||
release_apk: | ||
stage: release | ||
release:nightly: | ||
dependencies: | ||
- build_release | ||
- build | ||
stage: deploy | ||
only: | ||
- master | ||
- nightly | ||
script: | ||
- apk --update --no-cache add git openssl bash curl wget go | ||
- go get -u -v github.com/tcnksm/ghr | ||
- curl https://${KEYSTORE_SERVER}/gitlab-sshkey/github-key.env -o .reall_network/github-key.env -u gitlab:${key_store_passwd} | ||
- . .reall_network/github-key.env | ||
- ghr -t "${GITHUB_ACCESS_KEY}" -u "${OWNER}" -r "${REPO}" -b "$(cat .reall_network/changelog.txt)" "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}-$(date "+%Y%m%d%H%M")" "./app/build/outputs/apk/release/app-release.apk" | ||
- git push --set-upstream https://${GITHUB_ACCESS_KEY}@github.com/${OWNER}/${REPO}.git HEAD:refs/heads/${CI_COMMIT_REF_NAME} | ||
- /root/go/bin/ghr -t "${GITHUB_ACCESS_KEY}" -u "${OWNER}" -r "${REPO}" -c ${CI_COMMIT_REF_NAME} --prerelease "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}-$(date "+%Y%m%d%H%M")" "./app/build/outputs/apk/release/app-release.apk" | ||
|
||
build_release: | ||
build: | ||
image: alvrme/alpine-android:android-30-jdk11 | ||
stage: build | ||
only: | ||
- master | ||
retry: 2 | ||
script: | ||
- git submodule update --init --recursive | ||
- export VERSION_CODE=${CI_PIPELINE_ID} | ||
|
@@ -57,7 +52,8 @@ build_release: | |
- export GRADLE_USER_HOME=$(pwd)/.gradle && mkdir -p ${GRADLE_USER_HOME} | ||
- echo -e "org.gradle.jvmargs=-Xmx1536m\n org.gradle.parallel=true" >> ${GRADLE_USER_HOME}/gradle.properties | ||
- chmod +x ./gradlew | ||
- ./gradlew assembleReleas | ||
- ./gradlew app:copy_language_pack | ||
- ./gradlew assembleRelease | ||
artifacts: | ||
paths: | ||
- app/build/outputs/apk/release/app-release.apk | ||
|