Skip to content

Commit

Permalink
Add workflow for automatic releases
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jul 18, 2024
1 parent 516558f commit 997d613
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Java CI

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

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/configuration' && 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/"* ]]; 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@v2
with:
josm-revision: ${{ matrix.josm-revision }}
perform-revision-tagging: ${{ matrix.josm-revision == 'r19044' && needs.check-release-needed.outputs.release_needed == 'true' }}
secrets: inherit

2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="config" default="dist" basedir=".">
<property name="commit.message" value="Commit message"/>
<property name="plugin.main.version" value="18723"/>
<property name="plugin.main.version" value="19044"/>
<property name="plugin.author" value="Aarthy KC"/>
<property name="plugin.class" value="org.openstreetmap.josm.plugins.ConfigPlugin"/>
<property name="plugin.description" value="Task configurations"/>
Expand Down

0 comments on commit 997d613

Please sign in to comment.