From 750879dedb493c5775375f2741d7187b86a1a6a8 Mon Sep 17 00:00:00 2001 From: Harsh Verma <55652117+Harsh3305@users.noreply.github.com> Date: Fri, 30 Jun 2023 08:50:49 +0530 Subject: [PATCH] Add build in publish.yml workflow (#39) --- .github/workflows/publish.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5cc84a4..920aac0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,10 +15,33 @@ on: env: USERNAME: ${{ secrets.OSSRH_USERNAME }} TOKEN: ${{ secrets.OSSRH_TOKEN }} - PRODUCT_URL: ${{secrets.PRODUCT_URL}} jobs: + build: + name: Build + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build with Gradle + run: gradle clean build + env: + VERSION: "0.0.1-SNAPSHOT" publish: runs-on: ubuntu-latest + needs: build steps: - uses: actions/checkout@v3 - name: Set up JDK 17