From 21a4d48fb1b796885e06bdce1b6027eb74d7a536 Mon Sep 17 00:00:00 2001
From: Randall Wood <297232+rhwood@users.noreply.github.com>
Date: Sun, 15 Oct 2023 14:57:11 -0400
Subject: [PATCH] chore: build site using GitHub actions (#183)
---
.github/workflows/build.yml | 6 +----
.github/workflows/site.yml | 50 +++++++++++++++++++++++++++++++++++++
.gitignore | 3 +++
pom.xml | 12 +++++++++
4 files changed, 66 insertions(+), 5 deletions(-)
create mode 100644 .github/workflows/site.yml
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7b544e50..67a1f0ca 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -15,13 +15,9 @@ jobs:
matrix:
include:
- java: 8
- maven: verify
- java: 11
- maven: verify
- java: 17
- maven: verify
- java: 21
- maven: verify site
steps:
- uses: actions/checkout@v4
with:
@@ -38,7 +34,7 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
- run: xvfb-run mvn -B ${{ matrix.maven }}
+ run: xvfb-run mvn -B verify
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.java == '21'
diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml
new file mode 100644
index 00000000..2fabbbe9
--- /dev/null
+++ b/.github/workflows/site.yml
@@ -0,0 +1,50 @@
+name: Publish Site
+
+on:
+ # Runs on pushes targeting the default branch
+ push:
+ branches: ["main"]
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Allow one concurrent deployment
+concurrency:
+ group: "pages"
+ cancel-in-progress: true
+
+jobs:
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ # change to macos-latest once macos-13 becomes the latest
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # disable shallow checkouts
+ - name: Set up Java
+ uses: actions/setup-java@v3
+ with:
+ java-version: 21
+ distribution: 'temurin'
+ - name: Cache Maven packages
+ uses: actions/cache@v3
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2
+ - name: Generate site
+ run: xvfb-run mvn -B verify site
+ - name: Upload site artifact
+ uses: actions/upload-pages-artifact@v2
+ with:
+ # Upload docs directory
+ path: target/site
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d0b54a3b..fc29d8c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,8 @@ buildNumber.properties
.classpath
.vscode
+# IntelliJ Idea settings
+.idea
+
# macOS detritus
.DS_Store
diff --git a/pom.xml b/pom.xml
index 3b3117a2..c1ddd168 100644
--- a/pom.xml
+++ b/pom.xml
@@ -247,6 +247,18 @@ limitations under the License.
true
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.3.0
+
+
+
+ com.alexandriasoftware.swing.jsplitbutton
+
+
+
+
com.github.spotbugs
spotbugs-maven-plugin