From eb91fdd030033d2f4e87e2c6a0cf67b04af5a615 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 23 Apr 2024 10:02:26 +0200 Subject: [PATCH] chore: add jenkins pipeline --- Jenkinsfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 7 +++++-- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..a5f1f64 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,49 @@ +@Library('cadoles') _ + +// Utilisation du pipeline "standard" +// Voir https://forge.cadoles.com/Cadoles/Jenkins/src/branch/master/doc/tutorials/standard-make-pipeline.md +standardMakePipeline([ + 'baseImage': 'reg.cadoles.com/proxy_cache/library/ubuntu:24.04', + 'dockerfileExtension': ''' + ARG GOLANG_VERSION=1.22.0 + + ENV ANDROID_HOME=/opt/android-sdk-linux + ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle + ENV PATH=${PATH}:/usr/local/go/bin/:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools + + # Install utilities + RUN apt-get update -y \ + && apt-get install -y wget curl tar build-essential ca-certificates git openjdk-11-jdk-headless unzip locales jq moreutils + + # Set locale + RUN locale-gen en_US.UTF-8 + ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + + # Install Golang + RUN wget -O golang.tar.gz https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf golang.tar.gz + + # Install Android SDK/NDK + RUN mkdir -p /opt/android-sdk-linux + WORKDIR /opt/android-sdk-linux + + RUN wget -O commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip \ + && mkdir -p ${ANDROID_HOME}/cmdline-tools/latest \ + && unzip -q commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools/latest \ + && mv ${ANDROID_HOME}/cmdline-tools/latest/cmdline-tools/* ${ANDROID_HOME}/cmdline-tools/latest/ \ + && rm -f commandlinetools.zip + + RUN echo y | cmdline-tools/latest/bin/sdkmanager --install \ + 'platforms;android-29' \ + 'ndk-bundle' \ + 'build-tools;34.0.0' \ + 'tools' \ + 'platform-tools' \ + 'extras;android;m2repository' \ + 'extras;google;m2repository' \ + 'extras;google;google_play_services' + ''', + 'credentials': [ + usernamePassword(credentialsId: 'kipp-credentials', usernameVariable: 'MKT_GITEA_RELEASE_USERNAME', passwordVariable: 'MKT_GITEA_RELEASE_PASSWORD') + ] +]) \ No newline at end of file diff --git a/Makefile b/Makefile index c0e2d4e..64789f5 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,10 @@ tools/gogio/bin/gogio: mkdir -p tools/gogio/bin GOBIN=$(PWD)/tools/gogio/bin go install gioui.org/cmd/gogio@latest -gitea-release: .mktools build + +release: gitea-release + +gitea-release: .mktools build release-android rm -rf .gitea-release mkdir -p .gitea-release @@ -81,7 +84,7 @@ gitea-release: .mktools build cp ./bin/desktop_arm64 .gitea-release/arcad_player_linux_arm64 cp ./bin/client .gitea-release/arcad_client_linux_amd64 - cp ./android/app/build/outputs/apk/debug/app-debug.apk .gitea-release/arcast_player_debug.apk + cp ./android/app/build/outputs/apk/release/app-release-unsigned.apk .gitea-release/arcast_player.apk MKT_GITEA_RELEASE_PROJECT="arcast" \ MKT_GITEA_RELEASE_ORG="arcad" \