From 45f6480a823809144f91452971773e94729607bd Mon Sep 17 00:00:00 2001 From: qwe7002 Date: Thu, 7 Jul 2022 12:33:43 +0000 Subject: [PATCH 1/2] Update .reall_network/gitlab-ci.yml file --- .reall_network/gitlab-ci.yml | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.reall_network/gitlab-ci.yml b/.reall_network/gitlab-ci.yml index feeb912..e28ce6f 100644 --- a/.reall_network/gitlab-ci.yml +++ b/.reall_network/gitlab-ci.yml @@ -13,42 +13,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 @@ -58,3 +55,4 @@ build: paths: - app/build/outputs/apk/release/app-release.apk expire_in: 1 week + From 99efaea114df9bfb4c97222637610bd378b83db1 Mon Sep 17 00:00:00 2001 From: qwe7002 Date: Thu, 7 Jul 2022 12:35:27 +0000 Subject: [PATCH 2/2] Update .reall_network/gitlab-ci.yml file --- .reall_network/gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.reall_network/gitlab-ci.yml b/.reall_network/gitlab-ci.yml index e28ce6f..9e12d3c 100644 --- a/.reall_network/gitlab-ci.yml +++ b/.reall_network/gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - - deploy + - push + - release cache: key: ${CI_PROJECT_ID} paths: