diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fc47934 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: Build Verification + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java-version: [17, 21, 23] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with JDK ${{ matrix.java-version }} + run: ./gradlew build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba79d55..db168cc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,13 +1,15 @@ name: Publish to Maven Central Repository on: - push: - branches: - - master + workflow_run: + workflows: ["Verify"] + types: + - completed jobs: publish: runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/master' }} steps: - name: Checkout code @@ -52,4 +54,4 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} run: | - ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace --debug \ No newline at end of file + ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace --debug