-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure release profiles; Add GitHub workflows to build, test, and …
…release package. (#3)
- Loading branch information
1 parent
38821ec
commit 2635d94
Showing
3 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "build-and-release-package" | ||
|
||
on: "workflow_dispatch" | ||
|
||
concurrency: "${{github.workflow}}-${{github.ref}}" | ||
|
||
jobs: | ||
build-package: | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
packages: "write" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
with: | ||
submodules: "recursive" | ||
|
||
- uses: "actions/setup-java@v4" | ||
with: | ||
java-version: "11" | ||
distribution: "adopt" | ||
server-id: "ossrh" | ||
server-username: "MAVEN_USERNAME" | ||
server-password: "MAVEN_PASSWORD" | ||
gpg-private-key: "${{secrets.GPG_PRIVATE_KEY}}" | ||
gpg-passphrase: "MAVEN_GPG_PASSPHRASE" | ||
|
||
- name: "Build package, run tests, and deploy to GitHub" | ||
run: "mvn --batch-mode deploy -Pmaven_release" | ||
env: | ||
MAVEN_USERNAME: "${{secrets.OSSRH_USERNAME}}" | ||
MAVEN_PASSWORD: "${{secrets.OSSRH_TOKEN}}" | ||
MAVEN_GPG_PASSPHRASE: "${{secrets.GPG_PASSPHRASE}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "build-package" | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/build-package.yml" | ||
- "pom.xml" | ||
- "src/**" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{github.workflow}}-${{github.ref}}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-package: | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
packages: "write" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
with: | ||
submodules: "recursive" | ||
|
||
- uses: "actions/setup-java@v4" | ||
with: | ||
java-version: "11" | ||
distribution: "adopt" | ||
server-id: "github" | ||
|
||
- name: "Build package and run tests" | ||
run: "mvn --batch-mode test" | ||
|
||
- if: "${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}" | ||
name: "Deploy to GitHub" | ||
env: | ||
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}" | ||
run: "mvn --batch-mode deploy -DskipTests -Pgithub_release" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters