Skip to content

Commit 07383cc

Browse files
Minor changes to Node and Java publishing (#1008)
- Latest Node LTS ships with a version of npm recent enough to support trusted signing to no need to explicitly install latest npm. - No longer publish unstable/snapshot versions of Node and Java artifacts on every push. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent cb7c7b6 commit 07383cc

File tree

4 files changed

+3
-62
lines changed

4 files changed

+3
-62
lines changed

.github/scripts/maven_publish_release.sh renamed to .github/scripts/maven_publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eu -o pipefail
44

5-
PUBLISH_PROFILE="${1:?}"
5+
PUBLISH_PROFILE="${1:?Publish profile must be provided.}"
66

77
POM_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -q -DforceStdout)
88
PUBLISH_VERSION="${POM_VERSION%%-*}"

.github/scripts/maven_publish_snapshot.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -56,49 +56,3 @@ jobs:
5656
- name: Deploy to GitHub Pages
5757
id: deployment
5858
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
59-
60-
publish-node:
61-
needs: build
62-
name: Publish Node package to GitHub Packages
63-
runs-on: ubuntu-24.04
64-
permissions:
65-
contents: read
66-
packages: write
67-
concurrency:
68-
group: npm-pkg
69-
cancel-in-progress: false
70-
steps:
71-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
72-
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
73-
with:
74-
node-version: "lts/*"
75-
registry-url: "https://npm.pkg.github.com"
76-
- name: Build
77-
run: make build-node
78-
- name: Publish
79-
env:
80-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81-
run: ${{ github.workspace }}/.github/scripts/npm_publish.sh unstable
82-
working-directory: node
83-
84-
publish-java:
85-
needs: build
86-
name: Publish Java artifact to GitHub Packages
87-
runs-on: ubuntu-24.04
88-
permissions:
89-
contents: read
90-
packages: write
91-
steps:
92-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
93-
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
94-
with:
95-
java-version: 25
96-
distribution: temurin
97-
cache: maven
98-
- name: Publish
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
102-
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
103-
run: ${{ github.workspace }}/.github/scripts/maven_publish_snapshot.sh
104-
working-directory: java

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525
with:
2626
node-version: "lts/*"
2727
registry-url: "https://registry.npmjs.org"
28-
# Ensure npm 11.5.1 or later for trusted publishing support
29-
- name: Update npm
30-
run: npm install -g npm@latest
3128
- name: Build
3229
run: make build-node
3330
- name: Publish
@@ -53,7 +50,7 @@ jobs:
5350
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5451
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
5552
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
56-
run: ${{ github.workspace }}/.github/scripts/maven_publish_release.sh github
53+
run: ${{ github.workspace }}/.github/scripts/maven_publish.sh github
5754
working-directory: java
5855

5956
publish-java-central:
@@ -76,5 +73,5 @@ jobs:
7673
MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
7774
MAVEN_GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
7875
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
79-
run: ${{ github.workspace }}/.github/scripts/maven_publish_release.sh central
76+
run: ${{ github.workspace }}/.github/scripts/maven_publish.sh central
8077
working-directory: java

0 commit comments

Comments
 (0)