Skip to content

Commit

Permalink
ci: first setup of mvn deploy with github action (#93)
Browse files Browse the repository at this point in the history
* ci: first setup of mvn deploy with github action

* ci: fix on configuration
  • Loading branch information
danglotb authored Jun 17, 2021
1 parent 64a212f commit b6a01a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mvn-build-action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Java CI

on: [push]
on: [push, pull_request]

jobs:
build:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/mvn-deploy-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to the Maven Central Repository
on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup Maven Settings
run: cp .travis/travis-settings.xml $HOME/.m2/settings.xml
- name: Publish package
run: mvn deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSS_TESTRUNNER_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_TESTRUNNER_PASSWORD }}
4 changes: 2 additions & 2 deletions .travis/travis-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<servers>
<server>
<id>ossrh-test-runner-snapshots</id>
<username>${env.OSS_TESTRUNNER_USERNAME}</username>
<password>${env.OSS_TESTRUNNER_PASSWORD}</password>
<username>${secrets.OSS_TESTRUNNER_USERNAME}</username>
<password>${secrets.OSS_TESTRUNNER_PASSWORD}</password>
</server>
</servers>
</settings>

0 comments on commit b6a01a9

Please sign in to comment.