https://github.com/josm/josmpluginaction
https://github.com/josm/josmpluginaction
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/josm/josmpluginaction
- Owner: JOSM
- License: gpl-2.0
- Created: 2022-04-26T19:11:54.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T21:08:16.000Z (over 1 year ago)
- Last Synced: 2025-03-26T12:46:51.192Z (over 1 year ago)
- Language: TypeScript
- Size: 4.03 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JOSMPluginAction
This action / reusable workflow does the following:
1. Builds the appropriate JOSM version for your plugin
2. Builds your plugin
3. Runs your plugin tests
4. Adds a built jar to a GitHub release (triggered on the creation of the GitHub
release, steps 1-3 are run and must pass)
## Usage
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.
### Minimal Sample
```yaml
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
```
## Permissions reference:
* `id-token` and `attestations`: For writing attestation information
* `contents`: For auto tags and creating a release
* `packages`: For pushing to a GH package repo
## Inputs (all optional)
### `josm-revision`
The JOSM revision to use, defaults to an empty string (`''`). This uses the
current `svn` revision. If you want a specific revision, use `r`
(e.g. `r18563`). Alternatively, you can use `latest` or `tested`.
### `operating-system`
Use a specific operating system for running the action.
Defaults to `ubuntu-latest`.
### `java-version`
Use a specific java version for running the action. Defaults to `11`.
JOSM is dropping support for Java 8 starting in 2024 (see [#17858](https://josm.openstreetmap.de/ticket/17858#comment:149)),
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.
### `java-distribution`
Use a specific java distribution for running the action. Defaults to `temurin`.
## Environment variables
### `ANT_HOME`
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.
# License
GPL-2.0-or-later