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
56 changes: 50 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,43 @@ jobs:
-Prelease \
release:perform

# The published artifact set is defined by the Maven model (maven-deploy-plugin skip
# flags in the POMs); this step only verifies the outcome. It runs before the git push
# so that a broken publication fails the release without pushing commits or tags.
- name: Verify published artifact set
run: |
BASE_URL='https://eldonexus.de/repository/maven-public/nl/pim16aap2/BigDoors'
failed=0

# These artifacts (and their full parent POM chain) must be resolvable by consumers.
for artifact in \
"BigDoors-parent/${RELEASE_VERSION}/BigDoors-parent-${RELEASE_VERSION}.pom" \
"hooks/${RELEASE_VERSION}/hooks-${RELEASE_VERSION}.pom" \
"core/${RELEASE_VERSION}/core-${RELEASE_VERSION}.pom" \
"core/${RELEASE_VERSION}/core-${RELEASE_VERSION}.jar" \
"hooks-api/${RELEASE_VERSION}/hooks-api-${RELEASE_VERSION}.pom" \
"hooks-api/${RELEASE_VERSION}/hooks-api-${RELEASE_VERSION}.jar"; do
code=$(curl -s -o /dev/null -w '%{http_code}' "${BASE_URL}/${artifact}")
if [ "${code}" != "200" ]; then
echo "::error::Expected artifact missing (HTTP ${code}): ${artifact}"
failed=1
fi
done

# Internal modules must never be published.
for artifact in \
"nms-api/${RELEASE_VERSION}/nms-api-${RELEASE_VERSION}.pom" \
"hooks-bundle/${RELEASE_VERSION}/hooks-bundle-${RELEASE_VERSION}.pom" \
"nms/${RELEASE_VERSION}/nms-${RELEASE_VERSION}.pom"; do
code=$(curl -s -o /dev/null -w '%{http_code}' "${BASE_URL}/${artifact}")
if [ "${code}" != "404" ]; then
echo "::error::Internal artifact unexpectedly published (HTTP ${code}): ${artifact}"
failed=1
fi
done

exit "${failed}"

- name: Push release commits and tag
run: git push origin master --follow-tags

Expand Down Expand Up @@ -159,19 +196,26 @@ jobs:
core/target/BigDoors.jar.asc
core/target/BigDoors.jar.SHA-256

- name: Clear changelog for next release
- name: Clear changelog and bump README version for next release
env:
GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
Maven_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: |
echo "$GPG_KEY" | gpg --batch --import

version_line=$(echo "${{ env.NEXT_DEV_VERSION }}" | sed 's/-SNAPSHOT//g')
{ printf '%s\n\n' "$version_line"; cat changelog.txt; } > changelog.tmp
mv changelog.tmp changelog.txt

> NEXT_RELEASE_CHANGELOG.md

git add changelog.txt NEXT_RELEASE_CHANGELOG.md
git commit -S -m "chore: clear next changelog after v${{ env.RELEASE_VERSION }} release"

# Point the README dependency snippets at the version that was just released.
# The greps fail the step loudly if a README reformat ever breaks the sed patterns.
sed -i "s|<version>[0-9][0-9.]*</version>|<version>${RELEASE_VERSION}</version>|" README.md
sed -i "s|BigDoors:core:[0-9][0-9.]*|BigDoors:core:${RELEASE_VERSION}|" README.md
grep -q "<version>${RELEASE_VERSION}</version>" README.md
grep -q "BigDoors:core:${RELEASE_VERSION}" README.md

git add changelog.txt NEXT_RELEASE_CHANGELOG.md README.md
git commit -S -m "chore: clear changelog and bump README to v${{ env.RELEASE_VERSION }} after release"
git push origin master
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Static Badge](https://img.shields.io/nexus/r/nl.pim16aap2/BigDoors?color=green&label=BigDoors&logo=BigDoors&logoColor=red&server=https%3A%2F%2Feldonexus.de&style=flat-square)
[![BigDoors release](https://img.shields.io/github/v/release/PimvanderLoos/BigDoors?label=BigDoors&color=green&style=flat-square)](https://github.com/PimvanderLoos/BigDoors/releases/latest)

# BigDoors v1
BigDoors is a plugin for the Minecraft server mod [Spigot](https://spigotmc.org). Its aim is to enhance your server with
Expand Down Expand Up @@ -393,7 +393,7 @@ There are 2 modules available:
<dependency>
<groupId>nl.pim16aap2.BigDoors</groupId>
<artifactId>core</artifactId>
<version>0.1.8.64</version>
<version>0.1.8.68</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -407,7 +407,7 @@ maven {
}

dependencies {
compileOnly 'nl.pim16aap2.BigDoors:core:0.1.8.64'
compileOnly 'nl.pim16aap2.BigDoors:core:0.1.8.68'
}
```

Expand Down
22 changes: 22 additions & 0 deletions hooks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- Hook implementations are internal; only hooks-api (which overrides this) is published. -->
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<modules>
Expand Down Expand Up @@ -50,4 +52,24 @@
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${dependency.maven-deploy.version}</version>
<!--
This aggregator POM must be published: it is the parent of the published
hooks-api artifact, and Maven cannot resolve an artifact without its full
parent POM chain. 'inherited=false' limits this override to this module,
so the child hook modules keep the maven.deploy.skip=true default above.
-->
<inherited>false</inherited>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
2 changes: 2 additions & 0 deletions nms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,7 @@
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- NMS modules are internal implementation details; they are not published to the Maven repository. -->
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
</project>
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${dependency.maven-deploy.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
Expand Down