Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/VERSION.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# This is a generated file. Edit VERSION.template instead
#
VERSION=@VERSION@
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: "Run tests and build with Ant on any branch"

on:
push:
branches-ignore:
- "master"

jobs:
build:
name: "Test and Build"
runs-on: ubuntu-latest
env:
INSTALL4J_KEY: ${{ secrets.INSTALL4J_LICENSE_KEY_1 }}
continue-on-error: false

steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: "Generate version string"
id: get-version
run: |
VERSION=$(ant -q -S print_version)
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TAG=v${VERSION}" >> $GITHUB_OUTPUT

- name: "Set up JDK 11"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: "Sanity check"
id: sanity_check
run: |
# env
VERSION=${{ steps.get-version.outputs.VERSION }}
TAG=${{ steps.get-version.outputs.TAG }}
LASTTAG=$(git tag -l "v*" --sort='-committerdate' | head -1)

# version is v1.2.3
if [[ "${VERSION}" =~ ^[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$ ]]; then
echo "Version $VERSION is okay"
else
echo "Version format $VERSION is not okay!"
exit 1
fi

# tag is v1.2.3
if [[ "${TAG}" =~ ^v[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$ ]]; then
echo "Tag $TAG okay"
else
echo "Tag $TAG is not okay for version $VERSION!"
exit 1
fi

# new vesion defined
if [[ "$LASTTAG" == "$TAG" ]]; then
echo "Version not incremented, please update build.xml"
exit 1
else
echo "Version updated."
fi

- name: "Build with ant"
run: |
ant -noinput -buildfile build.xml distribute

- name: "Read RELEASENOTES and CHANGELOG"
id: changelog
run: |
cat RELEASENOTES.txt | iconv -f ISO-8859-1 > RELEASE.md
echo '' >> RELEASE.md
echo '## Excerpt from CHANGELOG' >> RELEASE.md
echo '' >> RELEASE.md
head -20 CHANGELOG.txt | iconv -f ISO-8859-1 >> RELEASE.md
echo '...' >> RELEASE.md

- name: "Upload binary artifacts"
uses: actions/upload-artifact@v4
with:
name: magellan2-plugins
path: |
RELEASE.md
release/*
122 changes: 0 additions & 122 deletions .github/workflows/publish-latest.yml

This file was deleted.

142 changes: 142 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: "Run tests, build artifacts, publish on default branch"

on:
push:
branches:
- "master"

jobs:
build:
name: "Test, Build and Create Release"
runs-on: ubuntu-latest
env:
INSTALL4J_KEY: ${{ secrets.INSTALL4J_LICENSE_KEY_1 }}
continue-on-error: false

steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0

- name: "Generate version string"
id: get-version
run: |
VERSION=$(ant -q -S print_version)
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "TAG=v${VERSION}" >> $GITHUB_OUTPUT

- name: "Set up JDK 11"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: "Sanity check"
id: sanity_check
run: |
# env
VERSION=${{ steps.get-version.outputs.VERSION }}
TAG=${{ steps.get-version.outputs.TAG }}
LASTTAG=$(git tag -l "v*" --sort='-committerdate' | head -1)

# version is v1.2.3
if [[ "${VERSION}" =~ ^[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$ ]]; then
echo "Version $VERSION is okay"
else
echo "Version format $VERSION is not okay!"
exit 1
fi

# tag is v1.2.3
if [[ "${TAG}" =~ ^v[0-9][0-9]*[.][0-9][0-9]*[.][0-9][0-9]*$ ]]; then
echo "Tag $TAG okay"
else
echo "Tag $TAG is not okay for version $VERSION!"
exit 1
fi

# new vesion defined
if [[ "$LASTTAG" == "$TAG" ]]; then
echo "Version not incremented, please update build.xml"
exit 1
else
echo "Version updated."
fi

- name: "Build with ant"
run: |
ant -noinput -buildfile build.xml distribute

- name: "Read RELEASENOTES and CHANGELOG"
id: changelog
run: |
cat RELEASENOTES.txt | iconv -f ISO-8859-1 > RELEASE.md
echo '' >> RELEASE.md
echo '## Excerpt from CHANGELOG' >> RELEASE.md
echo '' >> RELEASE.md
head -20 CHANGELOG.txt | iconv -f ISO-8859-1 >> RELEASE.md
echo '...' >> RELEASE.md

- name: "Upload binary artifacts"
uses: actions/upload-artifact@v4
with:
name: magellan2-plugins
path: |
RELEASE.md
release/*

- name: "Publish git tag vX.Y.Z"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=${{ steps.get-version.outputs.TAG }}
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git remote -v
gh release delete ${TAG} -y || echo "continuing ..."
git tag -f "${TAG}"
REMOTE="https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
git push --force "$REMOTE" "${TAG}"

- name: "Create Release"
uses: softprops/action-gh-release@v2
with:
target_commitish: master
tag_name: ${{ steps.get-version.outputs.TAG }}
draft: true
name: ${{ steps.get-version.outputs.TAG }}
body_path: RELEASE.md
files: |
README.md
RELEASENOTES.md
CHANGELOG.md
VERSION
release/*

- name: "Trigger meta action to inform homepage"
run: |
curl -sS -o meta.log \
-X POST https://api.github.com/repos/${{ github.repository_owner }}/magellan2.github.io/dispatches \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: token ${{ secrets.META_REPO_ACCESS }}' \
--data '{
"event_type": "actions-release-trigger",
"client_payload": {
"ref": "${{ github.ref }}",
"sha": "${{ github.sha }}",
"caller_repository": "${{ github.repository }}",
"meta_repository": "${{ github.repository_owner }}/magellan2.github.io",
"tag": "${{ steps.get-version.outputs.TAG }}",
"version": "${{ steps.get-version.outputs.VERSION }}",
"build": "",
"type": "plugins" }}'
if [ -s meta.log ]; then
cat meta.log
rm meta.log
exit -1
else
echo "meta action apparently successful"
rm meta.log
fi
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
release
magellan2
/magellan2
/VERSION
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 2025-05-28 - trickert (thoralf@m84.de)

* Reparing build process
* This version is now using Github Actions to create new releases.
* switching to new global homepage https://magellan2.github.io/
Loading