Skip to content

Commit

Permalink
Add autobuild script
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Aug 14, 2024
1 parent 36b0efa commit 6a52c0f
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Java CI

on:
push:
branches:
- master
- $default-branch
- $protected-branches
pull_request:
branches:
- master
- $default-branch
workflow_dispatch:

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

jobs:
check-release-needed:
runs-on: ubuntu-latest
outputs:
release_needed: ${{ steps.create_release_needed.outputs.release_needed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ (github.repository == 'JOSM/Dxf-Import' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request') && '0' || '1' }}

- name: Set release needed
id: create_release_needed
run: |
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/"* ]] || [[ $file = "data/*" ]] || [[ $file = "lib/*" ]] || [[ $file = "resources/*" ]] || [[ $file = "images/*" ]]; then
release_needed="true"
break
fi
done
echo "release_needed=$release_needed" >> $GITHUB_OUTPUT
call-workflow:
needs: check-release-needed
strategy:
matrix:
josm-revision: ["", "r19044"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: ${{ matrix.josm-revision }}
perform-revision-tagging: ${{ matrix.josm-revision == 'r19044' && needs.check-release-needed.outputs.release_needed == 'true' }}
revision-offset: 948
secrets: inherit

4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<!-- enter the SVN commit message -->
<property name="commit.message" value="This should be the first commit, not sure yet"/>
<!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
<property name="plugin.main.version" value="18464"/>
<property name="plugin.main.version" value="19044"/>
<property name="java.lang.version" value="11" />

<property name="plugin.author" value="Antochi Adrian and Trifan Adrian"/>
<property name="plugin.class" value="org.openstreetmap.josm.plugins.dxfimport.DxfImportPlugin"/>
<property name="plugin.description" value="Dxf Import"/>
<property name="plugin.icon" value="images/dxfIcon.png"/>
<property name="plugin.link" value="https://wiki.openstreetmap.org/wiki/JOSM/Plugins/DXF_import"/>
<property name="plugin.requires" value="apache-commons"/>
<property name="version.entry.commit.revision" value="1014"/>
<target name="additional-manifest">
<manifest file="MANIFEST" mode="update">
<attribute name="12671_Plugin-Url" value="1012;https://github.com/JOSM/Dxf-Import/releases/download/v1012/DxfImport.jar" />
Expand Down
88 changes: 88 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<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>1.0-SNAPSHOT</version>
</parent>
<artifactId>DxfImport</artifactId>

<url>${plugin.link}</url>
<developers>
<developer>
<name>Antochi Adrian</name>
</developer>
<developer>
<name>Trifan Adrian</name>
</developer>
</developers>
<properties>
<plugin.src.dir>src</plugin.src.dir>
<plugin.main.version>19044</plugin.main.version>
<plugin.author>Antochi Adrian and Trifan Adrian</plugin.author>
<plugin.class>org.openstreetmap.josm.plugins.dxfimport.DxfImportPlugin</plugin.class>
<plugin.description>Dxf Import</plugin.description>
<plugin.icon>images/dxfIcon.png</plugin.icon>
<plugin.link>https://wiki.openstreetmap.org/wiki/JOSM/Plugins/DXF_import</plugin.link>
<plugin.requires>apache-commons</plugin.requires>
</properties>
<dependencies>
<dependency>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>apache-commons</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<!-- Note: you will have to run mvn initialize to get this working. Sorry. -->
<groupId>org.kabeja</groupId>
<artifactId>kabeja</artifactId>
<version>0.5.0</version>
<exclusions>
<exclusion>
<groupId>de.miethxml</groupId>
<artifactId>miethxml-ui</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>default-initialize</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>lib/kabeja-0.5.0.jar</file>
<groupId>org.kabeja</groupId>
<artifactId>kabeja</artifactId>
<version>0.5.0</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
<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-Requires>${plugin.requires}</Plugin-Requires>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 6a52c0f

Please sign in to comment.