Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
qwe7002 authored and qwe7002 committed Jul 7, 2022
2 parents 559d16f + 99efaea commit 3a337f1
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .reall_network/gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
stages:
- build
- deploy
- push
- release
cache:
key: ${CI_PROJECT_ID}
paths:
Expand All @@ -13,42 +14,39 @@ variables:

release:master:
dependencies:
- build
stage: deploy
- build_release
stage: push
only:
- master
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
- apk --update --no-cache add git openssl bash curl wget
- wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz
- tar -zxvf ghr_v0.14.0_linux_amd64.tar.gz
- 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"
- ghr_v0.14.0_linux_amd64/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"

release:nightly:
dependencies:
- build
stage: deploy
- build_release
stage: push
only:
- 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
- apk --update --no-cache add git openssl bash curl wget
- wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz
- tar -zxvf ghr_v0.14.0_linux_amd64.tar.gz
- 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"
- ghr_v0.14.0_linux_amd64/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:
image: alvrme/alpine-android:android-30-jdk11
build_release:
image: alvrme/alpine-android:android-31-jdk11
stage: build
retry: 2
script:
- echo -n ${KEYSTORE} | base64 -d > app/keys.jks
- git submodule update --init --recursive
- export VERSION_CODE=${CI_PIPELINE_ID}
- export VERSION_NAME=${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}
- wget https://${KEYSTORE_SERVER}/android/telegram-sms/keys.jks -O app/keys.jks --http-user=gitlab --http-passwd=${key_store_passwd}
- wget https://${KEYSTORE_SERVER}/android/telegram-sms/keystore.env -O .reall_network/keystore.env --http-user=gitlab --http-passwd=${key_store_passwd}
- . .reall_network/keystore.env
- 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
Expand All @@ -58,3 +56,4 @@ build:
paths:
- app/build/outputs/apk/release/app-release.apk
expire_in: 1 week

0 comments on commit 3a337f1

Please sign in to comment.