Skip to content

Commit

Permalink
Transition to GitHub Actions, re #2
Browse files Browse the repository at this point in the history
  • Loading branch information
safris committed Dec 20, 2020
1 parent ab45938 commit 49f3aaf
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 46 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright (c) 2018 LibJ
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# You should have received a copy of The MIT License (MIT) along with this
# program. If not, see <http://opensource.org/licenses/MIT/>.

name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_VERSION: "3.5.2"
MAVEN_OPTS: "-Xms64M -Xmx1600M"
strategy:
matrix:
jdk: ['1.8', '11']

steps:
- name: Remove idle tools
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost $AGENT_TOOLSDIRECTORY
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}

- name: Set up Maven ${{ env.MAVEN_VERSION }}
run: |
sudo wget -qO- https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xz -C /opt
sudo ln -sf /opt/apache-maven-$MAVEN_VERSION $M2_HOME
- name: Build
env:
GPG: ${{ secrets.GPG }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
if [ "${{ matrix.jdk }}" = "1.8" ] &&
[ "${{ github.ref }}" = "refs/heads/master" ] &&
[ "${{ github.head_ref }}" = "" ]; then
echo $GPG | base64 -d | gpg --import --no-tty --batch --yes &> /dev/null &&
mvn -e -U -B -s settings.xml -DskipRTests -DrepoToken=$REPO_TOKEN deploy -P javadoc,report,deploy;
else
mvn -e -U -B -s settings.xml -DskipRTests install;
fi
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<repositories>
<repository>
<id>snapshots-repo</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
Expand All @@ -42,7 +42,7 @@
<pluginRepositories>
<pluginRepository>
<id>snapshots-repo</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
Expand Down

0 comments on commit 49f3aaf

Please sign in to comment.