diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0e718c..083db13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,9 @@ name: Java CI -on: [push] +on: + push: + branches-ignore: + - main jobs: build: @@ -10,31 +13,10 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.head_ref }} - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'adopt' - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_TOKEN - gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}} - gpg-passphrase: GPG_PASSPHRASE - - name: Bump version - id: bump - uses: mickem/gh-action-bump-maven-version@v1 - name: Build with Maven - run: mvn --batch-mode -Prelease deploy - - name: Release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.bump.outputs.tag }} - generate_release_notes: true - -env: - GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}} - OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}} - OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}} + run: mvn --batch-mode verify diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2bcedda..4bacbc8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,19 +1,43 @@ -name: Main +name: Java CI on: push: - tags: - - "*.*.*" - workflow_dispatch: - + branches: + - main jobs: build: runs-on: ubuntu-latest + steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_TOKEN + gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}} + gpg-passphrase: GPG_PASSPHRASE + - name: Bump version + id: bump + uses: mickem/gh-action-bump-maven-version@v1 + - name: Build with Maven + run: mvn --batch-mode -Prelease deploy - name: Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + tag_name: ${{ steps.bump.outputs.tag }} generate_release_notes: true + +env: + GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}} + OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}} + OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}