This is an automated email from the ASF dual-hosted git repository.
arm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-actions.git
The following commit(s) were added to refs/heads/main by this push:
new a7b5ba5 Update script for staging artifacts, set up Central deploy
a7b5ba5 is described below
commit a7b5ba54bd6e758a3636a22b626515587e323508
Author: Alastair McFarlane <[email protected]>
AuthorDate: Tue Jan 20 17:39:17 2026 +0000
Update script for staging artifacts, set up Central deploy
---
.github/workflows/distribute-maven-stg.yml | 39 ++++++++----
...stribute-maven-stg.yml => distribute-maven.yml} | 74 ++++++++++++----------
2 files changed, 66 insertions(+), 47 deletions(-)
diff --git a/.github/workflows/distribute-maven-stg.yml
b/.github/workflows/distribute-maven-stg.yml
index d9738b2..864183e 100644
--- a/.github/workflows/distribute-maven-stg.yml
+++ b/.github/workflows/distribute-maven-stg.yml
@@ -224,22 +224,35 @@ jobs:
FILES="" CLASSIFIERS="" TYPES=""
shopt -s nullglob
- for f in "$DIR/${BASE}"-*.*; do
- # Skip checksums and signatures
- [[ "$f" =~ \.(asc|sha1|sha256|sha512|md5)$ ]] && continue
- # Skip main jar and pom
+ for f in "$DIR/${BASE}"*.*; do
+ [[ "$f" =~ \.(sha1|sha256|sha512|md5)$ ]] && continue
[[ "$f" == "$DIR/${BASE}.jar" ]] && continue
[[ "$f" == "$DIR/${BASE}.pom" ]] && continue
-
- # Extract classifier and type from filename
- suffix="${f#$DIR/${BASE}-}"
- classifier="${suffix%.*}"
- type="${suffix##*.}"
-
- FILES="${FILES:+$FILES,}$f"
- CLASSIFIERS="${CLASSIFIERS:+$CLASSIFIERS,}$classifier"
- TYPES="${TYPES:+$TYPES,}$type"
+
+ suffix="${f#$DIR/${BASE}}"
+
+ if [[ "$suffix" =~ ^\.([^.]+)\.asc$ ]]; then
+ classifier=""
+ type="${BASH_REMATCH[1]}.asc"
+ elif [[ "$suffix" =~ ^-([^.]+)\.([^.]+)\.asc$ ]]; then
+ classifier="${BASH_REMATCH[1]}"
+ type="${BASH_REMATCH[2]}.asc"
+ elif [[ "$suffix" =~ ^-([^.]+)\.([^.]+)$ ]]; then
+ classifier="${BASH_REMATCH[1]}"
+ type="${BASH_REMATCH[2]}"
+ else
+ continue
+ fi
+
+ FILES="$FILES,$f"
+ CLASSIFIERS="$CLASSIFIERS,$classifier"
+ TYPES="$TYPES,$type"
done
+
+ # Strip leading comma
+ FILES="${FILES#,}"
+ CLASSIFIERS="${CLASSIFIERS#,}"
+ TYPES="${TYPES#,}"
mvn deploy:deploy-file \
-Dfile="$DIR/${BASE}.jar" \
diff --git a/.github/workflows/distribute-maven-stg.yml
b/.github/workflows/distribute-maven.yml
similarity index 87%
copy from .github/workflows/distribute-maven-stg.yml
copy to .github/workflows/distribute-maven.yml
index d9738b2..6bfcec3 100644
--- a/.github/workflows/distribute-maven-stg.yml
+++ b/.github/workflows/distribute-maven.yml
@@ -55,7 +55,7 @@ jobs:
env:
ATR_HOST: release-test.apache.org
SSH_PORT: 2222
- WORKFLOW: distribute-maven-stg.yml
+ WORKFLOW: distribute-maven.yml
NJORD_STORE: njord-deployer
RAO_USERNAME: ${{ secrets.RAO_USERNAME }}
RAO_PASSWORD: ${{ secrets.RAO_PASSWORD }}
@@ -73,12 +73,11 @@ jobs:
</pluginGroups>
<servers>
<server>
- <id>rao3</id>
- <username>${RAO_USERNAME}</username>
- <password>${RAO_PASSWORD}</password>
+ <id>central</id>
+ <username>${CENTRAL_USERNAME}</username>
+ <password>${CENTRAL_PASSWORD}</password>
<configuration>
- <njord.publisher>sonatype-nx3</njord.publisher>
-
<njord.publisher.sonatype-nx3.baseUrl>https://repository.apache.org:4443/</njord.publisher.sonatype-nx3.baseUrl>
+ <njord.publisher>sonatype-cp</njord.publisher>
</configuration>
</server>
</servers>
@@ -107,13 +106,11 @@ jobs:
</build>
<distributionManagement>
<repository>
- <id>rao3</id>
- <url>https://repository.apache.org:4443</url>
+ <id>central</id>
</repository>
</distributionManagement>
<properties>
-
<njord.publisher.sonatype-nx3.releaseRepositoryName>maven-staging</njord.publisher.sonatype-nx3.releaseRepositoryName>
<njord.tag>${TAG_NAME}</njord.tag>
</properties>
</project>
@@ -224,22 +221,35 @@ jobs:
FILES="" CLASSIFIERS="" TYPES=""
shopt -s nullglob
- for f in "$DIR/${BASE}"-*.*; do
- # Skip checksums and signatures
- [[ "$f" =~ \.(asc|sha1|sha256|sha512|md5)$ ]] && continue
- # Skip main jar and pom
+ for f in "$DIR/${BASE}"*.*; do
+ [[ "$f" =~ \.(sha1|sha256|sha512|md5)$ ]] && continue
[[ "$f" == "$DIR/${BASE}.jar" ]] && continue
[[ "$f" == "$DIR/${BASE}.pom" ]] && continue
-
- # Extract classifier and type from filename
- suffix="${f#$DIR/${BASE}-}"
- classifier="${suffix%.*}"
- type="${suffix##*.}"
-
- FILES="${FILES:+$FILES,}$f"
- CLASSIFIERS="${CLASSIFIERS:+$CLASSIFIERS,}$classifier"
- TYPES="${TYPES:+$TYPES,}$type"
+
+ suffix="${f#$DIR/${BASE}}"
+
+ if [[ "$suffix" =~ ^\.([^.]+)\.asc$ ]]; then
+ classifier=""
+ type="${BASH_REMATCH[1]}.asc"
+ elif [[ "$suffix" =~ ^-([^.]+)\.([^.]+)\.asc$ ]]; then
+ classifier="${BASH_REMATCH[1]}"
+ type="${BASH_REMATCH[2]}.asc"
+ elif [[ "$suffix" =~ ^-([^.]+)\.([^.]+)$ ]]; then
+ classifier="${BASH_REMATCH[1]}"
+ type="${BASH_REMATCH[2]}"
+ else
+ continue
+ fi
+
+ FILES="$FILES,$f"
+ CLASSIFIERS="$CLASSIFIERS,$classifier"
+ TYPES="$TYPES,$type"
done
+
+ # Strip leading comma
+ FILES="${FILES#,}"
+ CLASSIFIERS="${CLASSIFIERS#,}"
+ TYPES="${TYPES#,}"
mvn deploy:deploy-file \
-Dfile="$DIR/${BASE}.jar" \
@@ -252,21 +262,18 @@ jobs:
INPUTS_DISTRIBUTION_VERSION: ${{ inputs.distribution-version }}
- - name: Create staging tag
- run: |
- curl -X POST -u "$RAO_USERNAME:$RAO_PASSWORD" \
- "https://repository.apache.org:4443/service/rest/v1/tags" \
- -H "Content-Type: application/json" \
- -d "{\"name\": \"$TAG_NAME\"}"
+ # - name: Create tag
+ # run: |
+ # curl -X POST -u "$CENTRAL_USERNAME:$CENTRAL_PASSWORD" \
+ # "https://central.sonatype.com/service/rest/v1/tags" \
+ # -H "Content-Type: application/json" \
+ # -d "{\"name\": \"$TAG_NAME\"}"
- name: Get store ID and publish
- shell: bash
run: |
- set -euxo pipefail
- echo "Validating store: $NJORD_STORE-00001"
- mvn njord:validate -Dnjord.store=njord-deployer-00001
-Dnjord.publisher=sonatype-cp -Dnjord.details=true -q | sed -n '/Central
Requirements/,/ArtifactStore.*failed validation/{/ArtifactStore.*failed
validation/!s/^\[ERROR\] *//p}' | tee .err
echo "Publishing store: $NJORD_STORE-00001"
+ mvn njord:validate -Dnjord.store=$NJORD_STORE-00001
mvn njord:publish -Dnjord.store=$NJORD_STORE-00001
mvn njord:drop -Dnjord.store=$NJORD_STORE-00001
env:
@@ -330,9 +337,8 @@ jobs:
--arg workflow "$WORKFLOW" \
--arg run_id $RUN_ID \
--arg project_name "$INPUTS_PROJECT" \
- --arg err "$([ -f .err ] && [ -s .err ] && echo "Build failed:
$(cat .err)" || echo "")" \
--arg status "failed" \
- '{publisher:$publisher, jwt:$jwt, workflow:$workflow,
run_id:$run_id, project_name:$project_name, status:$status, message:$err}' |
+ '{publisher:$publisher, jwt:$jwt, workflow:$workflow,
run_id:$run_id, project_name:$project_name, status:$status, message:"GitHub
workflow failed"}' |
curl -sS --fail-with-body -X POST -H 'Content-Type:
application/json' -d @- \
"https://${ATR_HOST}/api/distribute/task/status"
env:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]