Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Test

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: eclipse-temurin:17-jdk

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Ant
run: |
apt-get update
apt-get install -y ant

- name: Show versions
run: |
java -version
ant -version

- name: Build and test
run: ant all

- name: Upload jars
uses: actions/upload-artifact@v4
with:
name: opendis7-jars
path: dist/*.jar
retention-days: 30

- name: Upload javadoc
uses: actions/upload-artifact@v4
with:
name: opendis7-javadoc
path: dist/javadoc/
retention-days: 30

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: build/test/results/
retention-days: 14
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-and-release:
runs-on: ubuntu-latest
container:
image: eclipse-temurin:17-jdk

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Ant and tools
run: |
apt-get update
apt-get install -y ant zip

- name: Build
run: ant all

- name: Create release bundle
run: |
mkdir -p release
cp dist/opendis7-*.jar release/
cp dist/license.txt release/
cp dist/license.html release/
cd release && zip -r ../opendis7-release.zip .

- name: Upload release assets
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
apt-get install -y gh
for jar in dist/opendis7-*.jar; do
gh release upload "${{ github.event.release.tag_name }}" "$jar" --clobber
done
gh release upload "${{ github.event.release.tag_name }}" opendis7-release.zip --clobber

- name: Upload artifacts
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: opendis7-release
path: |
dist/opendis7-*.jar
opendis7-release.zip
10 changes: 8 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,24 @@ POSSIBILITY OF SUCH DAMAGE.

<target name="view.issues.online" description="view online issues in web browser (NetBeans only)">
<echo message="https://github.com/open-dis/opendis7-java/issues" />
<!-- nbbrowse requires NetBeans IDE; commented out for headless/CI compatibility -->
<!--<nbbrowse url="https://github.com/open-dis/opendis7-java/issues" />-->
<!-- nbbrowse url= --> <echo message="https://github.com/open-dis/opendis7-java/issues" />
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>

<target name="view.javadoc.local" description="view local package javadoc in web browser (NetBeans only)">
<echo message="view local javadoc in ${dist.javadoc.dir} subdirectory"/>
<!-- nbbrowse requires NetBeans IDE; commented out for headless/CI compatibility -->
<!--<nbbrowse file="${dist.javadoc.dir}/index.html" />-->
<!-- nbbrowse file="${dist.javadoc.dir}/index.html" -->
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>

<target name="view.javadoc.online" description="view online package javadoc in web browser (NetBeans only)">
<echo message="view online javadoc in dist/javadoc subdirectory"/>
<!-- nbbrowse requires NetBeans IDE; commented out for headless/CI compatibility -->
<!--<nbbrowse url="https://savage.nps.edu/opendis7-java/javadoc" />-->
<!-- nbbrowse url= --> <echo message="https://savage.nps.edu/opendis7-java/javadoc" />
<!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. -->
</target>
Expand Down