Skip to content

Commit

Permalink
Switch to GitHub Actions to build
Browse files Browse the repository at this point in the history
  • Loading branch information
csowada committed Dec 16, 2020
1 parent c227085 commit 70759f1
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 135 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8

- name: Set up Java for Apache Maven Central
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml
java-version: 11

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Publish to Apache Maven Central
run: mvn deploy --batch-mode --update-snapshots -P sign,build-extras
env:
GITHUB_TOKEN: ${{ github.token }}
OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
26 changes: 22 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,33 @@ on:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8

- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
java-version: 11

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build witrh Maven
run: mvn --batch-mode --update-snapshots clean compile verify

- run: mkdir staging && cp target/*.jar staging

- name: Upload Maven build artifact
uses: actions/upload-artifact@v1
with:
name: artifact
path: staging
67 changes: 0 additions & 67 deletions .travis.settings.xml

This file was deleted.

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

7 changes: 0 additions & 7 deletions cd/before-deploy.sh

This file was deleted.

Binary file removed cd/codesigning.asc.enc
Binary file not shown.
6 changes: 0 additions & 6 deletions cd/deploy.sh

This file was deleted.

5 changes: 2 additions & 3 deletions cd/mvnsettings.xml → cd/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_JIRA_USERNAME}</username>
<password>${env.OSSRH_JIRA_PASSWORD}</password>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>

Expand All @@ -19,7 +19,6 @@
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
Expand Down
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
<Bundle-Version>${bundle.version}</Bundle-Version>
<Export-Package>de.csdev.ebus.*</Export-Package>
<opt>resolution:=optional</opt>
<Import-Package>org.slf4j;$[opt], com.fazecast.jSerialComm;$[opt], gnu.io;$[opt], org.eclipse.jdt.annotation;$[opt], *</Import-Package>
<Import-Package>org.slf4j;$[opt], com.fazecast.jSerialComm;$[opt], gnu.io;$[opt],
org.eclipse.jdt.annotation;$[opt], *</Import-Package>

<Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
<Build-Commit>${buildNumber}</Build-Commit>
Expand Down Expand Up @@ -176,6 +177,13 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -299,16 +307,14 @@
</dependencies>

<distributionManagement>

<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>

</distributionManagement>

</project>

0 comments on commit 70759f1

Please sign in to comment.