Skip to content

Commit d08eddb

Browse files
committed
Fix server-id, validate version
1 parent 07b35e1 commit d08eddb

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
push:
1010
tags:
1111
- "*"
12-
- "!*-rc*"
1312
- "!*.pr*"
1413
- "!*b"
1514

@@ -18,18 +17,22 @@ jobs:
1817
runs-on: "ubuntu-20.04"
1918
env:
2019
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
20+
TAG: ${{ github.ref_name }}
2121
outputs:
2222
hash: ${{ steps.hash.outputs.hash }}
2323
artifact_name: ${{ steps.hash.outputs.artifact_name }}
2424
steps:
25+
- name: Validate version name
26+
run: |
27+
[[ "$TAG" =~ jackson-core-[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)? ]] || exit 1
2528
- uses: actions/checkout@v3
2629
- name: Set up JDK
2730
uses: actions/setup-java@v3
2831
with:
2932
distribution: "temurin"
3033
java-version: "8"
3134
cache: "maven"
32-
server-id: sonatype-nexus-snapshots
35+
server-id: sonatype-nexus-staging
3336
server-username: CI_DEPLOY_USERNAME
3437
server-password: CI_DEPLOY_PASSWORD
3538
# See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven

release.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22

3-
# This script simulates the Maven Release Plugin, but only performs release:clean and
4-
# release:prepare. The release:perform step is handled by the CI when the tag is
5-
# pushed.
3+
# This script simulates the Maven Release Plugin, but only performs
4+
# release:clean and release:prepare. The release:perform step is handled by the
5+
# CI when the tag is pushed.
66
#
77
# However, release:perform on Git requires the release.properties file. We must
8-
# therefore modify the first commit created by release:prepare to include this file, and
9-
# then delete the file in the second commit.
8+
# therefore modify the first commit created by release:prepare to include this
9+
# file, and then delete the file in the second commit.
1010
#
11-
# This will ensure that release.properties is available to release:perform in the CI,
12-
# while keeping with the expectation that this file does not get commited (long-term) to
13-
# the repository.
11+
# This will ensure that release.properties is available to release:perform in
12+
# the CI, while keeping with the expectation that this file does not get
13+
# commited (long-term) to the repository.
1414

1515
set -euo pipefail
1616

@@ -21,7 +21,7 @@ set -euo pipefail
2121
git reset HEAD~1
2222

2323
# delete tag created by release:prepare
24-
tag_name=$(git tag --points-at)
24+
tag_name="$(git tag --points-at)"
2525
git tag -d "$tag_name"
2626

2727
# Add release.properties to that commit
@@ -31,7 +31,8 @@ git commit --amend --no-edit
3131
# recreate tag
3232
git tag "$tag_name" -m "[maven-release-plugin] copy for tag $tag_name"
3333

34-
# Recreate second commit, removing release.properties from the repository
34+
# Recreate second commit (from release to SNAPSHOT), removing
35+
# release.properties from the repository
3536
git rm release.properties
3637
git add pom.xml
3738
git commit -m "[maven-release-plugin] prepare for next development iteration"
@@ -40,4 +41,5 @@ git commit -m "[maven-release-plugin] prepare for next development iteration"
4041
git push
4142
git push origin "$tag_name"
4243

44+
# clean up
4345
rm pom.xml.releaseBackup

0 commit comments

Comments
 (0)