diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..44afcb3 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,22 @@ +name: Java CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, '[maven-release-plugin]') }} + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Set up Node 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Build with Maven + run: mvn --batch-mode --update-snapshots install \ No newline at end of file diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..ba3ecf3 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,34 @@ +name: release and push to central +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: accessible-sortable-list + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Set up Node 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Publish to Apache Maven Central + run: mvn -Prelease deploy + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PW }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ No newline at end of file