Skip to content
Snippets Groups Projects
Commit 0f3ed979 authored by Jonas Broeckmann's avatar Jonas Broeckmann
Browse files

CI use package registry

parent 4a566100
No related branches found
No related tags found
No related merge requests found
Pipeline #1269317 passed
......@@ -12,6 +12,8 @@ image: eclipse-temurin:17-jdk-jammy
variables:
APP_VERSION: "1.0.0"
APP_APK: "kaffeekasse-${APP_VERSION}.apk"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/kaffeekasse/${APP_VERSION}"
# ANDROID_COMPILE_SDK is the version of Android you're compiling with.
# It should match compileSdkVersion.
......@@ -107,28 +109,43 @@ assembleRelease:
paths:
- app/build/outputs/apk/release
createRelease:
createPackage:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
image: curlimages/curl:latest
needs:
- job: assembleRelease
artifacts: true
rules:
- if: $CI_COMMIT_TAG
before_script: []
script:
- cp app/build/outputs/apk/release/app-release.apk $APP_APK
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file $APP_APK "${PACKAGE_REGISTRY_URL}/${APP_APK}"
createRelease:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs: [createPackage]
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
before_script: []
script:
- echo "Creating a new release for version $APP_VERSION"
- cp app/build/outputs/apk/release/app-release.apk kaffeekasse-${CI_COMMIT_TAG}.apk
artifacts:
expire_in: never
paths:
- kaffeekasse.apk
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
name: '$APP_VERSION'
description: '$APP_VERSION' # TODO: Add meaningful description
assets:
links:
- name: 'kaffeekasse-${APP_VERSION}.apk'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/kaffeekasse-${APP_VERSION}.apk'
- |
release-cli create --name "$APP_VERSION" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${APP_APK}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_APK}\"}"
# - cp app/build/outputs/apk/release/app-release.apk kaffeekasse-${APP_VERSION}.apk
# artifacts:
# expire_in: never
# paths:
# - kaffeekasse.apk
# release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
# tag_name: '$CI_COMMIT_TAG'
# name: '$APP_VERSION'
# description: '$APP_VERSION' # TODO: Add meaningful description
# assets:
# links:
# - name: 'kaffeekasse-${APP_VERSION}.apk'
# url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/kaffeekasse-${APP_VERSION}.apk'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment