From 60a524d02010849d6341242860bc40e881ffaf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Miguel=20Rubio?= Date: Fri, 27 Sep 2024 07:59:57 +0200 Subject: [PATCH] ci:[ANDROAPP-6258] Publish release on github (#303) * docs: [ANDROAPP-6258] add create Github release job * docs: [ANDROAPP-6258] comment tag * docs: [ANDROAPP-6258] rename tag variable * docs: [ANDROAPP-6258] generate desktop jars * docs: [ANDROAPP-6258] generate desktop jars * docs: [ANDROAPP-6258] generate desktop jars * docs: [ANDROAPP-6258] generate desktop jars * test * test * test * test * test * test * test * test * ci: [ANDROAPP-6258] deploy release --- .github/workflows/continuous-deployment.yml | 55 +++++++++++++++++---- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index 3438728e4..95f2bf789 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -1,20 +1,22 @@ -# This is a basic workflow to help you get started with Actions - name: Continuous deployment -# Controls when the workflow will run +env: + main_project_module: android + on: push: branches: - - develop + - develop # Automatically generates snapshot versions - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + workflow_dispatch: ## manually generates release versions + inputs: + release_version: + description: 'Please, enter the release version' + required: true + type: string -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - publish: + publish-maven: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -41,3 +43,38 @@ jobs: OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }} SIGNING_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }} SIGNING_PASSWORD: ${{ secrets.PGP_PASSPHRASE }} + + publish_github: + runs-on: ubuntu-latest + if: ${{ (inputs.release_version) && (inputs.release_version != '') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: 'gradle' + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + - name: Build Android (APK) - ${{ env.main_project_module }} module + run: ./gradlew assembleDebug + + - name: Rename APK + run: | + mv ${{ env.main_project_module }}/build/outputs/apk/debug/android-debug.apk ${{ env.main_project_module }}/build/outputs/apk/debug/ui-components-android-${{ inputs.release_version }}.apk + + + - name: Github Release + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: true + draft: true + generateReleaseNotes: true + name: "Release notes - DHIS2 Design system: ${{ inputs.release_version }}" + tag: ${{ inputs.release_version }} + artifacts: ${{ env.main_project_module }}/build/outputs/apk/debug/ui-components-android-${{ inputs.release_version }}.apk