From bb8720d517fca185eaaf392333c286837073faff Mon Sep 17 00:00:00 2001
From: Randall Wood <297232+rhwood@users.noreply.github.com>
Date: Sun, 15 Oct 2023 15:34:59 -0400
Subject: [PATCH] chore: publish site with GitHub Action (#252)
* chore: publish site with GitHub Action
* remove IDE settings
* ignore IDE settings
---
.classpath | 49 --------------------
.github/workflows/build.yml | 8 +---
.github/workflows/site.yml | 54 ++++++++++++++++++++++
.gitignore | 9 ++++
.project | 34 --------------
.settings/org.eclipse.core.resources.prefs | 5 --
.settings/org.eclipse.jdt.apt.core.prefs | 2 -
.settings/org.eclipse.jdt.core.prefs | 9 ----
.settings/org.eclipse.m2e.core.prefs | 4 --
.vscode/launch.json | 28 -----------
.vscode/settings.json | 9 ----
11 files changed, 65 insertions(+), 146 deletions(-)
delete mode 100644 .classpath
create mode 100644 .github/workflows/site.yml
delete mode 100644 .project
delete mode 100644 .settings/org.eclipse.core.resources.prefs
delete mode 100644 .settings/org.eclipse.jdt.apt.core.prefs
delete mode 100644 .settings/org.eclipse.jdt.core.prefs
delete mode 100644 .settings/org.eclipse.m2e.core.prefs
delete mode 100644 .vscode/launch.json
delete mode 100644 .vscode/settings.json
diff --git a/.classpath b/.classpath
deleted file mode 100644
index 39abf1c5..00000000
--- a/.classpath
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 72eaa9ce..fb16a644 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -18,13 +18,9 @@ jobs:
matrix:
include:
- java: 8
- maven: verify
- java: 11
- maven: verify
- java: 17
- maven: verify
- java: 21
- maven: verify site
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
@@ -46,9 +42,9 @@ 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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
- if: matrix.java == '17'
+ if: matrix.java == '21'
with:
token: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml
new file mode 100644
index 00000000..bf51a38d
--- /dev/null
+++ b/.github/workflows/site.yml
@@ -0,0 +1,54 @@
+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 }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
+ with:
+ egress-policy: audit
+
+ - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ with:
+ fetch-depth: 0 # disable shallow checkouts
+ - name: Set up Java
+ uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
+ with:
+ java-version: 21
+ distribution: 'temurin'
+ - name: Cache Maven packages
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ 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@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
+ with:
+ # Upload docs directory
+ path: target/site
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5 # v2.0.4
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 70794f99..77d94a90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,12 @@ hs_err_pid*
# macOS artifacts
.DS_Store
+
+# IntelliJ Idea settings
+.idea
+
+# Eclipse and VSCode settings
+/.project
+/.classpath
+/.vscode/
+/.settings/
diff --git a/.project b/.project
deleted file mode 100644
index b2651219..00000000
--- a/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- jinputvalidator
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.m2e.core.maven2Builder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.m2e.core.maven2Nature
-
-
-
- 1624013463618
-
- 30
-
- org.eclipse.core.resources.regexFilterMatcher
- node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
-
-
-
-
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 839d647e..00000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/java=UTF-8
-encoding//src/main/resources=UTF-8
-encoding//src/test/java=UTF-8
-encoding/=UTF-8
diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs
deleted file mode 100644
index d4313d4b..00000000
--- a/.settings/org.eclipse.jdt.apt.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.apt.aptEnabled=false
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1b6e1ef2..00000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
-org.eclipse.jdt.core.compiler.processAnnotations=disabled
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f1..00000000
--- a/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index a73e8897..00000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- // Use IntelliSense to learn about possible attributes.
- // Hover to view descriptions of existing attributes.
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "type": "java",
- "name": "Debug (Launch) - Current File",
- "request": "launch",
- "mainClass": "${file}"
- },
- {
- "type": "java",
- "name": "Debug (Launch)-JInputValidatorShowAll",
- "request": "launch",
- "mainClass": "com.alexandriasoftware.swing.JInputValidatorShowAll",
- "projectName": "jinputvalidator"
- },
- {
- "type": "java",
- "name": "Debug (Launch)-JInputValidatorSwingTest",
- "request": "launch",
- "mainClass": "com.alexandriasoftware.swing.JInputValidatorSwingTest",
- "projectName": "jinputvalidator"
- }
- ]
-}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index c7f54828..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "java.configuration.updateBuildConfiguration": "automatic",
- "files.exclude": {
- "**/.classpath": true,
- "**/.project": true,
- "**/.settings": true,
- "**/.factorypath": true
- }
-}
\ No newline at end of file