From 5d783f724d88493c47ee1c93360409756199a0e7 Mon Sep 17 00:00:00 2001 From: jastornig Date: Tue, 19 Dec 2023 16:03:51 +0000 Subject: [PATCH] Resolve "make Releases public and downloadable" --- .gitlab-ci.yml | 62 +++++++++++++++++++++++++++++--------------------- README.md | 6 ++++- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db0b975..375770d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,48 +16,58 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + stages: # List of stages for jobs, and their order of execution - build - # - test - # - deploy + - release -build-job: +build_job: image: "reactnativecommunity/react-native-android:latest" stage: build # This job runs in the build stage, which runs first. + rules: + - if: $COMMIT_BRANCH == "main" + when: manual + - if: $COMMIT_BRANCH != "main" + when: never script: - - echo $PWD - - echo $CI_PROJECT_DIR + - echo BUILD_JOB_ID=$CI_JOB_ID >> environment.env - yarn add expo - npx expo prebuild --platform android - cd android && ./gradlew assembleRelease - cd $CI_PROJECT_DIR - - cp android/app/build/outputs/apk/release/app-release.apk finanzfuchs-$CI_COMMIT_REF_NAME.apk + - cp android/app/build/outputs/apk/release/app-release.apk finanzfuchs-is1-group-g-$CI_COMMIT_REF_NAME.apk + - echo RELEASE_APK=finanzfuchs-is1-group-g-$CI_COMMIT_REF_NAME.apk >> environment.env artifacts: untracked: false name: $CI_PROJECT_NAME-group-g-finanzfuchs-$CI_COMMIT_REF_NAME paths: - "finanzfuchs-is1-group-g-$CI_COMMIT_REF_NAME.apk" + reports: + dotenv: environment.env when: on_success - expire_in: 30 days - + expire_in: 60 days when: manual -# unit-test-job: # This job runs in the test stage. -# stage: test # It only starts when the job in the build stage completes successfully. -# script: -# - echo "Running unit tests... This will take about 60 seconds." -# - sleep 60 -# - echo "Code coverage is 90%" -# lint-test-job: # This job also runs in the test stage. -# stage: test # It can run at the same time as unit-test-job (in parallel). -# script: -# - echo "Linting code... This will take about 10 seconds." -# - sleep 10 -# - echo "No lint issues found." + -# deploy-job: # This job runs in the deploy stage. -# stage: deploy # It only runs when *both* jobs in the test stage complete successfully. -# environment: production -# script: -# - echo "Deploying application..." -# - echo "Application successfully deployed." +release_job: + stage: release + image: "registry.gitlab.com/gitlab-org/release-cli:latest" + needs: + - job: build_job + rules: + - if: $COMMIT_BRANCH == "main" + when: manual + - if: $COMMIT_BRANCH != "main" + when: never + + release: + tag_name: 'v0.$CI_PIPELINE_IID' + description: 'v0.$CI_PIPELINE_IID create by pipeline' + ref: '$CI_COMMIT_SHA' + assets: + links: + - name: APK + url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/${RELEASE_APK}' + script: + - echo "Deploying" \ No newline at end of file diff --git a/README.md b/README.md index 53037e9..b0f9a14 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Finanzfuchs ## Installation and Setup +### Run with expo go (ios and Android) To install and run Finanzfuchs locally: Required: `npm` (node packet manager), `node.js` (recommended latest stable) @@ -19,6 +20,9 @@ Required: `npm` (node packet manager), `node.js` (recommended latest stable) 3. After installing, just scan the QR Code using the App on Android or the Camera-App on iOS. 5. Alternatively you can use an Emulator using Android SDK or the iOS equivalent. After starting the server, press the prefered Button `a` for Android, `i` for iOS or `w` for Web-View **(Web-View is currently not supported) ** +### Prebuilt apk (Android only) +A more convenient way to run Finanzfuchs is to Download the prebuilt apk which can be found under releases in this GitLab repository. This apk file will be kept up to date. Just download and isntall the most recent version. + ## Usage - **Adding Expenses**: Press the plus button to add expenses. @@ -34,4 +38,4 @@ Required: `npm` (node packet manager), `node.js` (recommended latest stable) - Walcher, Raphael ## License -Finanzfuchs is released under the [MIT License]. \ No newline at end of file +Finanzfuchs is released under the [MIT License].