Skip to content

Commit

Permalink
pre/post release steps
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jul 24, 2024
1 parent e95aeeb commit 75b3c14
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
java-version: '22'
cache: maven
server-id: central
server-username: NEXUS_USER
server-password: NEXUS_PASSWORD
server-username: MAVEN_USER
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY_GITHUB_TECHUSER }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

Expand All @@ -40,24 +40,58 @@ jobs:
- name: Diag
run: |
echo "====================="
echo " Maven"
echo " Maven "
echo "====================="
mvn -v
echo "====================="
echo " Global settings"
echo " Global settings "
echo "====================="
cat $HOME/.m2/settings.xml
echo ""
echo "====================="
echo " Git config"
echo " Git config "
echo "====================="
git config -l --global
- name: Release preparation
id: pre-release
shell: bash
run: |
gh extension install valeriobelli/gh-milestone
version=$(mvn -q -DforceStdout help:evaluate -N -Dexpression=project.version | sed -rn 's/([^-]+)(-SNAPSHOT|)$/\1/p')
echo "VERSION=$version" >> "$GITHUB_OUTPUT"
- name: Release
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_KEY_FINGERPRINT: '0x0181A4828FA27B6BE6F1F5A68611CD28F472E006!'
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_USER: ${{ secrets.NEXUS_USER }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
mvn -B release:prepare release:perform -Darguments="-DskipTests"
- name: Post release
run: |
version=${{ steps.pre-release.outputs.VERSION }}
echo "Trying to find milestone $version"
milestone=$(gh milestone list --json id,title,state --jq "map_values(select(.title == \"${version}\" and .state == \"OPEN\")).[].number")
if [ -z "$milestone" ]; then
echo "Found milestone $version, closing it"
gh milestone edit $milestone --state closed
fi
version=$(mvn -q -DforceStdout help:evaluate -N -Dexpression=project.version | sed -rn 's/([^-]+)(-SNAPSHOT|)$/\1/p')
echo "Preparing development $version"
echo "Trying to find milestone $version"
milestone=$(gh milestone list --json id,title,state --jq "map_values(select(.title == \"${version}\" and .state == \"OPEN\")).[].number")
if [ ! -z "$milestone" ]; then
echo "Creating milestone $version"
gh milestone create --title $milestone
fi
name=$(mvn -q -DforceStdout help:evaluate -N -Dexpression=project.name)
version=${{ steps.pre-release.outputs.VERSION }}
tag=$(git describe --tags --abbrev=0)
echo "Creating release \"$name $version\" from tag $tag"
gh release create $tag --verify-tag --notes-from-tag --title "$name $version"
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<artifactId>jline-parent</artifactId>
<version>3.29.6-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JLine Parent</name>
<name>JLine</name>
<description>JLine</description>
<url>https://github.com/jline/jline3</url>

Expand Down
Binary file removed pom.xml.gpg
Binary file not shown.

0 comments on commit 75b3c14

Please sign in to comment.