Skip to content

Commit

Permalink
Update build code
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Aug 29, 2024
1 parent 795b0bc commit 460f64f
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 18 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ant-release.yml

This file was deleted.

40 changes: 36 additions & 4 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,47 @@ on:
branches:
- master
- $default-branch
schedule:
- cron: "22 18 * * 5"
workflow_dispatch:

permissions:
id-token: write
attestations: write
contents: write
packages: write
checks: 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/kartverketimport' && 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: ["", "r14628"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v1
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' }}
secrets: inherit

5 changes: 3 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

<target name="additional-manifest">
<manifest file="MANIFEST" mode="update">
<attribute name="12643_Plugin-Url" value="v1.0;https://github.com/JOSM/kartverketimport/releases/download/v1.0/kartverketimport.jar" />
<attribute name="14153_Plugin-Url" value="v1.0;https://github.com/JOSM/kartverketimport/releases/download/v1.0.1/kartverketimport.jar" />
<attribute name="12643_Plugin-Url" value="v1.0;https://github.com/JOSM/kartverketimport/releases/download/v1.0/kartverketimport.jar" />
<attribute name="14153_Plugin-Url" value="v1.0.1;https://github.com/JOSM/kartverketimport/releases/download/v1.0.1/kartverketimport.jar" />
<attribute name="14628_Plugin-Url" value="v1.0.3;https://github.com/JOSM/kartverketimport/releases/download/v1.0.3/kartverketimport.jar" />
</manifest>
</target>

Expand Down
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<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>kartverketimport</artifactId>

<url>${plugin.link}</url>
<developers>
<developer>
<name>Torstein Ingebrigtsen Bø</name>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<plugin.src.dir>src</plugin.src.dir>
<plugin.main.version>19044</plugin.main.version>
<plugin.author>Torstein Ingebrigtsen Bø</plugin.author>
<plugin.class>org.openstreetmap.josm.plugins.kartverket.KartverketPlugin</plugin.class>
<plugin.description>Tools to help import Kartverket N50</plugin.description>
<plugin.link>https://github.com/JOSM/kartverketimport</plugin.link>
<plugin.requires>utilsplugin2</plugin.requires>
<plugin.canloadatruntime>true</plugin.canloadatruntime>
</properties>
<dependencies>
<dependency>
<groupId>org.openstreetmap.josm.plugins</groupId>
<artifactId>utilsplugin2</artifactId>
<version>SNAPSHOT</version>
<scope>provided</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-Requires>${plugin.requires}</Plugin-Requires>
<Plugin-Canloadatruntime>${plugin.canloadatruntime}</Plugin-Canloadatruntime>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 460f64f

Please sign in to comment.