Skip to content

Commit

Permalink
Improve GitHub Actions workflows (#24)
Browse files Browse the repository at this point in the history
- Only upload artifacts for `master` commits
- Publish any tag prefixed with `v` to Maven Central
- Delete some unnecessary POM configuration
  • Loading branch information
ferdinand-swoboda committed Mar 26, 2022
1 parent fb52791 commit 34a9456
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
8 changes: 3 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -663,9 +658,6 @@
</forcedType>
</forcedTypes>
</database>
<generate>
<varargSetters>false</varargSetters>
</generate>
<target>
<packageName>io.github.ferdinandswoboda.folo.data.schema</packageName>
<directory>${project.build.directory}/generated-test-sources/jooq</directory>
Expand Down

0 comments on commit 34a9456

Please sign in to comment.