This action / reusable workflow does the following:
- Builds the appropriate JOSM version for your plugin
- Builds your plugin
- Runs your plugin tests
- Adds a built jar to a GitHub release (triggered on the creation of the GitHub release, steps 1-3 are run and must pass)
Note that currently only JOSM/JOSMPluginAction/workflows/ant.yml
should
be used externally.
If you use the cron schedule, use
awk 'BEGIN { srand(); print int(60 * rand()) " " int(24 * rand()) " * * " int(7 * rand()) ;}'
to generate a random day and time. Also, replace $default-branch
with the
actual default branch (GitHub actions doesn't currently allow that variable in
the originating workflow).
We recommend using at least two separate jobs. The first should compile your
plugin with the minimum JOSM version, and the second should compile your plugin
with the current JOSM svn
head. The job targetting the current svn
revision
should not be called by a release
trigger. Use the minimum JOSM version for
that.
name: Java CI
on:
push:
branches:
- $default-branch
- $protected-branches
pull_request:
branches:
- $default-branch
release:
types: [created]
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
call-workflow:
permissions:
id-token: write
attestations: write
contents: write
packages: write
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
id-token
andattestations
: For writing attestation informationcontents
: For auto tags and creating a releasepackages
: For pushing to a GH package repo
The JOSM revision to use, defaults to an empty string (''
). This uses the
current svn
revision. If you want a specific revision, use r<REVISION>
(e.g. r18563
). Alternatively, you can use latest
or tested
.
Use a specific operating system for running the action.
Defaults to ubuntu-latest
.
Use a specific java version for running the action. Defaults to 11
.
JOSM is dropping support for Java 8 starting in 2024 (see #17858),
so this action is now running the compilation process using Java 11. Use the
build property java.lang.version
to set the target Java version, if necessary.
Use a specific java distribution for running the action. Defaults to temurin
.
This sets both the ant
home, but do note that it is used to download the
specified ant
version. Defaults to apache-ant-1.10.14
. You should generally
avoid changing this environment variable. Open a pull request first.
GPL-2.0-or-later