Skip to content

Commit

Permalink
Update pom and github workflow for auto releases
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jan 30, 2025
1 parent 96d8fb3 commit 14bebe6
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 114 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ on:
branches:
- master
- $default-branch
schedule:
- cron: "43 13 * * 1"
workflow_dispatch:

permissions:
id-token: write
attestations: write
contents: write
packages: write
checks: write

jobs:
check-release-needed:
runs-on: ubuntu-latest
Expand All @@ -31,23 +36,27 @@ jobs:
last_tag=$(git describe --tags --abbrev=0 --always)
release_needed="false"
for file in $(git diff ${last_tag}..HEAD --name-only); do
if [[ $file = "src/main"* ]]; then
if [[ $file = "src/main/"* ]] || [[ $file = "data/"* ]]; then
release_needed="true"
break
fi
done
echo "release_needed=$release_needed" >> $GITHUB_OUTPUT
call-workflow:
needs: check-release-needed
strategy:
matrix:
josm-revision: ["", "r18877"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2
josm-revision: ["", "r19044"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: ${{ matrix.josm-revision }}
java-version: 17
perform-revision-tagging: ${{ matrix.josm-revision == 'r18877' && needs.check-release-needed.outputs.release_needed == 'true' }}
perform-revision-tagging: ${{ github.repository == 'JOSM/MapRoulette' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request' && matrix.josm-revision == 'r19044' }}
secrets: inherit

permissions:
attestations: write
checks: write
contents: write
deployments: write
id-token: write
45 changes: 21 additions & 24 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="MapRoulette" default="dist" basedir="." xmlns:mvn="antlib:org.apache.maven.resolver.ant">
<property name="plugin.src.dir" value="src/main/java"/>
<property name="plugin.test.dir" location="src/test"/>
<property name="plugin.resources.dir" value="src/main/resources"/>
<!-- enter the SVN commit message -->
<property name="commit.message" value="Commit message"/>
<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
<property name="plugin.main.version" value="18877"/>

<property name="plugin.author" value="Taylor Smock"/>
<property name="plugin.class" value="org.openstreetmap.josm.plugins.maproulette.MapRoulette"/>
<property name="plugin.description" value="MapRoulette Tasks in JOSM"/>
<property name="plugin.icon" value="images/dialogs/user_no_image.png"/>
<property name="plugin.link" value="https://github.com/JOSM/MapRoulette"/>
<property name="plugin.minimum.java.version" value="17"/>
<property name="java.lang.version" value="17"/>
<property name="plugin.canloadatruntime" value="true"/>

<!-- ** include targets that all plugins have in common ** -->
<import file="../build-common.xml"/>

<target name="pre-compile" depends="fetch_dependencies">
<!-- include fetch_dependencies task -->
</target>
<project xmlns:mvn="antlib:org.apache.maven.resolver.ant" name="MapRoulette" default="dist" basedir=".">
<property name="plugin.src.dir" value="src/main/java"/>
<property name="plugin.test.dir" location="src/test"/>
<property name="plugin.resources.dir" value="src/main/resources"/>
<!-- enter the SVN commit message -->
<property name="commit.message" value="Commit message"/>
<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
<property name="plugin.main.version" value="18877"/>
<property name="plugin.author" value="Taylor Smock"/>
<property name="plugin.class" value="org.openstreetmap.josm.plugins.maproulette.MapRoulette"/>
<property name="plugin.description" value="MapRoulette Tasks in JOSM"/>
<property name="plugin.icon" value="images/dialogs/user_no_image.png"/>
<property name="plugin.link" value="https://github.com/JOSM/MapRoulette"/>
<property name="plugin.minimum.java.version" value="17"/>
<property name="java.lang.version" value="17"/>
<property name="plugin.canloadatruntime" value="true"/>
<!-- ** include targets that all plugins have in common ** -->
<import file="../build-common.xml"/>
<target name="pre-compile" depends="fetch_dependencies">
<!-- include fetch_dependencies task -->
</target>
</project>
186 changes: 104 additions & 82 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,83 +1,105 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>plugin-root</artifactId>
<version>SNAPSHOT</version>
</parent>
<artifactId>maproulette</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<plugin.src.dir>${project.basedir}/src/main/java</plugin.src.dir>
<plugin.resources.dir>${project.basedir}/src/main/resources</plugin.resources.dir>
<plugin.test.dir>${project.basedir}/src/test/</plugin.test.dir>
<plugin.test.data.dir>${plugin.test.dir}/resources</plugin.test.data.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.22.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<eclipse>
<version>4.21</version>
<file>${project.basedir}/../00_core_tools/eclipse/formatter.xml</file>
</eclipse>
<removeUnusedImports/>
<licenseHeader>
<content>// License: GPL. For details, see LICENSE file.</content>
</licenseHeader>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>17</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>plugin-root</artifactId>
<version>SNAPSHOT</version>
</parent>
<artifactId>maproulette</artifactId>
<version>SNAPSHOT</version>
<properties>
<java.lang.version>17</java.lang.version>
<plugin.main.version>19044</plugin.main.version>
<plugin.src.dir>${project.basedir}/src/main/java</plugin.src.dir>
<plugin.resources.dir>${project.basedir}/src/main/resources</plugin.resources.dir>
<plugin.test.dir>${project.basedir}/src/test/</plugin.test.dir>
<plugin.test.data.dir>${plugin.test.dir}/resources</plugin.test.data.dir>
<plugin.author>Taylor Smock</plugin.author>
<plugin.class>org.openstreetmap.josm.plugins.maproulette.MapRoulette</plugin.class>
<plugin.description>MapRoulette Tasks in JOSM</plugin.description>
<plugin.icon>images/dialogs/user_no_image.png</plugin.icon>
<plugin.link>https://github.com/JOSM/MapRoulette</plugin.link>
<plugin.minimum.java.version>${java.lang.version}</plugin.minimum.java.version>
<plugin.canloadatruntime>true</plugin.canloadatruntime>
</properties>
<dependencies>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.22.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Plugin-Link>${plugin.link}</Plugin-Link>
<Plugin-Icon>${plugin.icon}</Plugin-Icon>
<Plugin-Canloadatruntime>${plugin.canloadatruntime}</Plugin-Canloadatruntime>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.lang.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<eclipse>
<version>4.21</version>
<file>${project.basedir}/../00_core_tools/eclipse/formatter.xml</file>
</eclipse>
<removeUnusedImports/>
<licenseHeader>
<content>// License: GPL. For details, see LICENSE file.</content>
</licenseHeader>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${java.lang.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 14bebe6

Please sign in to comment.