Skip to content

Commit b3d410f

Browse files
committed
Add GitHub Actions CI and manual deploy workflows
1 parent fdd84b8 commit b3d410f

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- "*.x"
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
MAVEN_OPTS: '-Xmx4G -Xms1G -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED -Djavax.xml.accessExternalDTD=all -Djavax.xml.accessExternalSchema=all'
16+
MAVEN_CLI_OPTS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
17+
18+
jobs:
19+
incremental-build:
20+
if: github.event_name == 'pull_request'
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: temurin
30+
cache: maven
31+
- name: Incremental Build
32+
run: mvn clean install $MAVEN_CLI_OPTS -DskipTests
33+
34+
full-build:
35+
if: github.event_name == 'push'
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 30
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Set up JDK 17
41+
uses: actions/setup-java@v4
42+
with:
43+
java-version: '17'
44+
distribution: temurin
45+
cache: maven
46+
- name: Full Build
47+
run: mvn clean install $MAVEN_CLI_OPTS -DskipTests
48+
49+
# Deploy is handled by release.yml

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
packages: write
9+
10+
env:
11+
MAVEN_OPTS: '-Xmx4G -Xms1G -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED -Djavax.xml.accessExternalDTD=all -Djavax.xml.accessExternalSchema=all'
12+
MAVEN_CLI_OPTS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
environment: production
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: temurin
25+
cache: maven
26+
- name: Configure Maven settings
27+
uses: s4u/maven-settings-action@v3.0.0
28+
with:
29+
servers: |
30+
[{
31+
"id": "releases",
32+
"username": "${{ github.actor }}",
33+
"password": "${{ secrets.GITHUB_TOKEN }}"
34+
},
35+
{
36+
"id": "snapshots",
37+
"username": "${{ github.actor }}",
38+
"password": "${{ secrets.GITHUB_TOKEN }}"
39+
}]
40+
- name: Deploy
41+
run: >-
42+
mvn deploy $MAVEN_CLI_OPTS
43+
-DskipTests=true
44+
-DretryFailedDeploymentCount=10
45+
-Dreleases.repository.url=https://maven.pkg.github.com/codice/javaapiforkml
46+
-Dsnapshots.repository.url=https://maven.pkg.github.com/codice/javaapiforkml

0 commit comments

Comments
 (0)