Skip to content

Commit 72ffd40

Browse files
author
mrhunsaker
committed
added actions
1 parent 5e17485 commit 72ffd40

16 files changed

Lines changed: 503 additions & 334 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Lint GitHub Workflows
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- '.github/workflows/**'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
actionlint:
17+
name: actionlint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install ShellCheck (for shell script checks)
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y --no-install-recommends shellcheck
27+
28+
- name: Install actionlint
29+
run: |
30+
set -euxo pipefail
31+
tmpdir=$(mktemp -d)
32+
curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash -o "$tmpdir/download.sh"
33+
bash "$tmpdir/download.sh" -b "$tmpdir"
34+
sudo mv "$tmpdir"/actionlint /usr/local/bin/actionlint
35+
actionlint -version
36+
37+
- name: Run actionlint
38+
run: |
39+
actionlint -color

.github/workflows/ci-maven.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PR Build (Maven)
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: pr-build-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Temurin JDK 21
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: temurin
26+
java-version: '21'
27+
cache: maven
28+
29+
- name: Maven verify (skip tests)
30+
run: mvn -B -ntp -q -DskipTests verify
Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,60 @@
1-
name: Deploy API Docs (Javadocs Only)
2-
3-
on:
4-
push:
5-
branches: [main]
6-
workflow_dispatch:
7-
8-
jobs:
9-
build-and-deploy:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v4
13-
14-
- name: Set up JDK
15-
uses: actions/setup-java@v4
16-
with:
17-
distribution: temurin
18-
java-version: "21"
19-
20-
- name: Cache Maven repository
21-
uses: actions/cache@v4
22-
with:
23-
path: ~/.m2/repository
24-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25-
restore-keys: ${{ runner.os }}-m2-
26-
27-
- name: Build Maven site (includes apidocs)
28-
run: mvn -B -DskipTests site
29-
30-
- name: Determine project version
31-
id: get-version
32-
run: echo "version=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)" >> $GITHUB_OUTPUT
33-
34-
- name: Prepare versioned Javadocs
35-
run: |
36-
mkdir -p build/site-workdir
37-
cp -R target/site/apidocs build/site-workdir/apidocs-temp
38-
chmod +x scripts/generate-javadoc-index.sh
39-
scripts/generate-javadoc-index.sh --root build/site-workdir --version "${{ steps.get-version.outputs.version }}" --latest --project-url https://github.com/YOUR_USERNAME/YOUR_REPO_NAME --package com.digitizer.ui
40-
41-
- name: Deploy versioned Javadocs to GitHub Pages
42-
uses: peaceiris/actions-gh-pages@v3
43-
with:
44-
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
publish_dir: build/site-workdir
46-
publish_branch: gh-pages
47-
force_orphan: true
48-
disable_nojekyll: true
1+
name: Deploy API Docs (Javadocs Only)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up JDK
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: temurin
18+
java-version: "21"
19+
20+
- name: Cache Maven repository
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: ${{ runner.os }}-m2-
26+
27+
- name: Build Maven site and apidocs
28+
run: |
29+
mvn -B -ntp -DskipTests site
30+
# Ensure apidocs are present; if not, generate explicitly
31+
if [ ! -d target/site/apidocs ]; then
32+
echo "apidocs not found after 'mvn site'; generating explicitly via javadoc:javadoc" >&2
33+
mvn -B -ntp -DskipTests javadoc:javadoc
34+
fi
35+
test -d target/site/apidocs || { echo "ERROR: target/site/apidocs still missing after generation" >&2; exit 1; }
36+
37+
- name: Determine project version
38+
id: get-version
39+
run: echo "version=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)" >> $GITHUB_OUTPUT
40+
41+
- name: Prepare versioned Javadocs
42+
run: |
43+
mkdir -p build/site-workdir
44+
cp -R target/site/apidocs build/site-workdir/apidocs-temp
45+
chmod +x scripts/generate-javadoc-index.sh
46+
scripts/generate-javadoc-index.sh \
47+
--root build/site-workdir \
48+
--version "${{ steps.get-version.outputs.version }}" \
49+
--latest \
50+
--project-url "https://github.com/${{ github.repository }}" \
51+
--package com.digitizer.ui
52+
53+
- name: Deploy versioned Javadocs to GitHub Pages
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: build/site-workdir
58+
publish_branch: gh-pages
59+
force_orphan: true
60+
disable_nojekyll: true
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build and Release Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
- "V*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
linux-packages:
14+
name: Linux Packages (AppImage, DEB, RPM)
15+
runs-on: ubuntu-latest
16+
env:
17+
APP_NAME: GraphDigitizer
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Temurin JDK 21
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: temurin
26+
java-version: '21'
27+
cache: maven
28+
29+
- name: Install packaging dependencies (deb/rpm/fpm)
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y --no-install-recommends \
33+
fakeroot rpm ruby ruby-dev rubygems build-essential xz-utils zsync wget
34+
sudo gem install --no-document fpm
35+
36+
- name: Install appimagetool
37+
run: |
38+
set -euxo pipefail
39+
wget -O appimagetool.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
40+
chmod +x appimagetool.AppImage
41+
./appimagetool.AppImage --appimage-extract
42+
sudo mv squashfs-root/AppRun /usr/local/bin/appimagetool
43+
sudo chmod +x /usr/local/bin/appimagetool
44+
45+
- name: Build with Maven
46+
run: mvn -B -ntp -DskipTests package
47+
48+
- name: Derive version from tag
49+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
50+
51+
- name: Ensure scripts executable
52+
run: chmod +x scripts/*.sh
53+
54+
- name: Generate DEB
55+
run: ./scripts/generate-deb.sh "$VERSION"
56+
57+
- name: Generate RPM
58+
run: ./scripts/generate-rpm.sh "$VERSION"
59+
60+
- name: Generate AppImage
61+
run: ./scripts/generate-appimage.sh "$VERSION"
62+
63+
- name: Upload Linux artifacts to Release
64+
uses: softprops/action-gh-release@v2
65+
if: startsWith(github.ref, 'refs/tags/')
66+
with:
67+
files: |
68+
target/generated_builds/**/*.deb
69+
target/generated_builds/**/*.rpm
70+
target/generated_builds/**/*.AppImage
71+
fail_on_unmatched_files: false
72+
73+
macos-dmg:
74+
name: macOS DMG
75+
runs-on: macos-latest
76+
env:
77+
APP_NAME: GraphDigitizer
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
82+
- name: Set up Temurin JDK 21
83+
uses: actions/setup-java@v4
84+
with:
85+
distribution: temurin
86+
java-version: '21'
87+
cache: maven
88+
89+
- name: Build with Maven
90+
run: mvn -B -ntp -DskipTests package
91+
92+
- name: Derive version from tag
93+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
94+
95+
- name: Ensure scripts executable
96+
run: chmod +x scripts/*.sh
97+
98+
- name: Generate DMG
99+
run: ./scripts/generate-dmg.sh "$VERSION"
100+
101+
- name: Upload macOS artifacts to Release
102+
uses: softprops/action-gh-release@v2
103+
if: startsWith(github.ref, 'refs/tags/')
104+
with:
105+
files: |
106+
target/generated_builds/**/*.dmg
107+
fail_on_unmatched_files: false

.scripts/find_missing_javadoc.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import pathlib,re
2-
root=pathlib.Path('src/main/java')
3-
missing=[]
4-
for p in sorted(root.rglob('*.java')):
5-
s=p.read_text(encoding='utf-8')
6-
m=re.search(r'^(?:\s*)public\s+(class|record|enum|interface)\s+\w+', s, flags=re.M)
7-
if m:
8-
start=m.start()
9-
before=s[:start]
10-
# look for a /** that starts a javadoc block in the last 10 lines before
11-
prev_lines=before.rstrip('\n').split('\n')[-10:]
12-
has_javadoc=False
13-
for line in reversed(prev_lines):
14-
if '/**' in line:
15-
has_javadoc=True
16-
break
17-
if line.strip()=='' or line.strip().startswith('*') or line.strip().startswith('/*'):
18-
continue
19-
if not line.strip().startswith('//'):
20-
break
21-
if not has_javadoc:
22-
missing.append(str(p))
23-
print('\n'.join(missing))
24-
print('MISSING_COUNT:', len(missing))
1+
import pathlib,re
2+
root=pathlib.Path('src/main/java')
3+
missing=[]
4+
for p in sorted(root.rglob('*.java')):
5+
s=p.read_text(encoding='utf-8')
6+
m=re.search(r'^(?:\s*)public\s+(class|record|enum|interface)\s+\w+', s, flags=re.M)
7+
if m:
8+
start=m.start()
9+
before=s[:start]
10+
# look for a /** that starts a javadoc block in the last 10 lines before
11+
prev_lines=before.rstrip('\n').split('\n')[-10:]
12+
has_javadoc=False
13+
for line in reversed(prev_lines):
14+
if '/**' in line:
15+
has_javadoc=True
16+
break
17+
if line.strip()=='' or line.strip().startswith('*') or line.strip().startswith('/*'):
18+
continue
19+
if not line.strip().startswith('//'):
20+
break
21+
if not has_javadoc:
22+
missing.append(str(p))
23+
print('\n'.join(missing))
24+
print('MISSING_COUNT:', len(missing))

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Apache License
22
Version 2.0, January 2004
3-
http://www.apache.org/licenses/
3+
https://www.apache.org/licenses/
44

55
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
66

META-INF/MANIFEST.MF

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Manifest-Version: 1.0
2-
Created-By: Maven JAR Plugin 3.3.0
3-
Build-Jdk-Spec: 24
4-
Main-Class: com.digitizer.ui.GraphDigitizerApp
5-
1+
Manifest-Version: 1.0
2+
Created-By: Maven JAR Plugin 3.3.0
3+
Build-Jdk-Spec: 24
4+
Main-Class: com.digitizer.ui.GraphDigitizerApp
5+

0 commit comments

Comments
 (0)