From 34a945681d1ea8f827bd9fc7d26ad5190517d836 Mon Sep 17 00:00:00 2001 From: Ferdinand Swoboda Date: Sat, 26 Mar 2022 13:18:56 +0100 Subject: [PATCH] Improve GitHub Actions workflows (#24) - Only upload artifacts for `master` commits - Publish any tag prefixed with `v` to Maven Central - Delete some unnecessary POM configuration --- .github/workflows/development.yaml | 14 +++++++------- .github/workflows/release.yaml | 8 +++----- README.md | 2 +- pom.xml | 8 -------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml index c5d50a1..af213b6 100644 --- a/.github/workflows/development.yaml +++ b/.github/workflows/development.yaml @@ -18,12 +18,6 @@ jobs: cache: maven - name: Build & verify with Maven run: mvn verify -strict-checksums --errors --show-version --batch-mode --update-snapshots --file pom.xml - - run: mkdir staging && cp target/*.jar staging - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: Package - path: staging release-snapshot: needs: - build @@ -42,9 +36,15 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - - name: Publish package + - name: Publish snapshot artifact run: mvn --batch-mode -Prelease -Drevision=${GITHUB_SHA}-SNAPSHOT clean deploy env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + - run: mkdir staging && cp target/*.jar staging + - name: Upload artifact sources + uses: actions/upload-artifact@v3 + with: + name: Sources + path: staging diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 57d083b..a6a0c26 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,13 +1,11 @@ -name: Publish package to the Maven Central Repository +name: Publish to Maven Central Repository on: push: tags: - - '**' + - 'v*' jobs: publish: runs-on: ubuntu-latest - # only consider tags on the master branch - if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v3 - name: Set up Maven Central Repository @@ -21,7 +19,7 @@ jobs: gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Publish package - run: mvn --batch-mode -Prelease -Drevision=${GITHUB_SHA} clean deploy + run: mvn --batch-mode -Prelease -Drevision=${GITHUB_REF_NAME#v} clean deploy env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/README.md b/README.md index cdfa086..53f9381 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ dependencies { ## Limitations/Potential improvements -- Investigate `@Nullable`, `@NonNull`, `@CheckReturnValue` and `@Contract` annotations. - Make use of Java modules (introduced in Java 9). +- Investigate `@Nullable`, `@NonNull`, `@CheckReturnValue` and other annotations. - Only primary / foreign keys of (Java) type `long` are supported i.e. no composite or UUID keys. - Relation mapping does not work for entities that are not based on a table in the DB schema. diff --git a/pom.xml b/pom.xml index e23c740..0edcd77 100644 --- a/pom.xml +++ b/pom.xml @@ -464,11 +464,6 @@ org.apache.maven.plugins maven-resources-plugin 3.2.0 - - - @ - - org.apache.maven.plugins @@ -663,9 +658,6 @@ - - false - io.github.ferdinandswoboda.folo.data.schema ${project.build.directory}/generated-test-sources/jooq