From 74ae1843b45f2922381a449b880602f89342a334 Mon Sep 17 00:00:00 2001 From: Paulanerus <41129807+Paulanerus@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:49:38 +0100 Subject: [PATCH] ci: Added API build and upload step to release workflow --- .github/workflows/build-and-publish.yml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index e74d130..f54d360 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -27,6 +27,35 @@ jobs: - name: Create Release run: gh release create v${{ steps.extract_version.outputs.ver }} --generate-notes + build-api: + needs: create-release + + runs-on: ubuntu-latest + + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ needs.create-release.outputs.version }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4.5.0 + with: + java-version: '21' + distribution: 'corretto' + cache: 'gradle' + + - name: Extract API Version + run: echo "API_VERSION=$(grep 'api.version=' gradle.properties | cut -d '=' -f2)" >> $GITHUB_ENV + + - name: Build API + run: ./gradlew :api:build + + - name: Upload API + run: gh release upload v${{ env.VERSION }} api/build/libs/api-${{ API_VERSION }}.jar --clobber + build: needs: create-release