Skip to content

Commit 7c9ccc5

Browse files
authored
chore: test trusted publishing (#1397)
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅 You can expedite processing of your PR by using this template to provide context and additional information. Before actually opening a PR please make sure that it does NOT fall into any of the following categories 🚫 Spam PRs (accidental or intentional) - these will result in a 30-days or even ∞ ban from interacting with the project depending on reoccurrence and severity. 🚫 Lazy typo fixing PRs - if you fix a typo in a file, your PR will only be merged if all other typos in the same file are also fixed with the same PR 🚫 If you fail to provide any _Description_ below, your PR will be considered spam. If you do not check the _Affirmation_ box below, your PR will not be merged. 🚫 If you do not check one of the _AI Tool Disclosure_ boxes below, your PR will not be merged. If you used AI tools to assist you in writing code, but fail to provide the required disclosure, your PR will not be merged. 🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅--> ### Description <!-- ✍️--> A clear and concise summary of the change and which issue (if any) it fixes. Should also include relevant motivation and context. Resolves or fixes issue: <!-- ✍️ Add GitHub issue number in format `#0000` or `none` --> ### AI Tool Disclosure - [x] My contribution does not include any AI-generated content - [ ] My contribution includes AI-generated content, as disclosed below: - AI Tools: `[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]` - LLMs and versions: `[e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]` - Prompts: `[Summarize the key prompts or instructions given to the AI tools]` ### Affirmation - [x] My code follows the [CONTRIBUTING.md](https://github.com/CycloneDX/cyclonedx-javascript-library/blob/main/CONTRIBUTING.md) guidelines --------- Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com> Signed-off-by: jkowalleck <jkowalleck@users.noreply.github.com> Co-authored-by: jkowalleck <jkowalleck@users.noreply.github.com>
1 parent ae34166 commit 7c9ccc5

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ env:
3535
REPORTS_DIR: CI_reports
3636
PACKED_DIR: CI_packed
3737
PACKED_ARTIFACT: packed
38-
NODE_ACTIVE_LTS: "24"
38+
NODE_ACTIVE_LTS: "24" # https://nodejs.org/en/about/releases/
3939

4040
jobs:
4141
bump:
@@ -57,22 +57,20 @@ jobs:
5757
run: |
5858
set -eux
5959
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
60-
git config --local user.name "${GITHUB_ACTOR}"
60+
git config --local user.name "${GITHUB_ACTOR}"
6161
- name: Setup Node.js ${{ env.NODE_ACTIVE_LTS }}
6262
# see https://github.com/actions/setup-node
6363
uses: actions/setup-node@v6
6464
with:
6565
node-version: ${{ env.NODE_ACTIVE_LTS }}
6666
package-manager-cache: false
67-
- name: update npm
68-
run: npm install -g npm@latest
6967
## ! no npm build at the moment
7068
- name: bump VERSION
7169
id: bump
7270
run: |
7371
set -eux
7472
COMMIT_SIG="Signed-off-by: $(git config user.name) <$(git config user.email)>"
75-
VERSION="$( npm version "$NPMV_NEWVERSION" --message "$NPMV_MESSAGE"$'\n\n'"$COMMIT_SIG" --preid "$NPMV_PREID" )"
73+
VERSION="$(npm version "$NPMV_NEWVERSION" --message "$NPMV_MESSAGE"$'\n\n'"$COMMIT_SIG" --preid "$NPMV_PREID")"
7674
echo "::debug::new version = $VERSION"
7775
VERSION_PLAIN="${VERSION:1}" # remove 'v' prefix
7876
echo "::debug::plain version = $VERSION_PLAIN"
@@ -85,10 +83,10 @@ jobs:
8583
- name: git push back
8684
run: git push --follow-tags
8785

88-
publish-package:
86+
publish-NPMJS-GH:
8987
needs:
9088
- "bump"
91-
name: publish package
89+
name: publish NPMJS & GH
9290
runs-on: ubuntu-latest
9391
timeout-minutes: 30
9492
permissions:
@@ -108,12 +106,10 @@ jobs:
108106
with:
109107
node-version: ${{ env.NODE_ACTIVE_LTS }}
110108
package-manager-cache: false
111-
- name: update npm
112-
run: npm install -g npm@latest
113109
- name: setup project
114110
run: |
115111
npm install --ignore-scripts --include=optional --loglevel=silly
116-
- name: setup tools
112+
- name: install tools
117113
run: |
118114
echo "::group::install docs-gen deps"
119115
npm run -- dev-setup:tools:docs-gen --ignore-scripts --loglevel=silly
@@ -125,20 +121,16 @@ jobs:
125121
npm run -- dev-setup:tools:test-dependencies --ignore-scripts --loglevel=silly
126122
echo "::endgroup::"
127123
# no explicit npm build. if a build is required, it should be configured as prepublish/prepublishOnly script of npm.
128-
- name: login to registries
129-
run: |
130-
npm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
131-
npm config set "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN"
132-
env:
133-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
135124
- name: publish to NPMJS as "${{ env.PACKAGE_RELEASE_TAG }}"
136125
run: >
137126
npm publish
138-
--@cyclonedx:registry='https://registry.npmjs.org'
139127
--provenance
140-
--access public
128+
--access public
141129
--tag "$PACKAGE_RELEASE_TAG"
130+
- name: login to GH package registries
131+
run: npm config set "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN"
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142134
- name: publish to GitHub as "${{ env.PACKAGE_RELEASE_TAG }}"
143135
run: >
144136
npm publish
@@ -161,7 +153,7 @@ jobs:
161153
release-GH:
162154
needs:
163155
- "bump"
164-
- "publish-package"
156+
- "publish-NPMJS-GH"
165157
name: publish GitHub
166158
runs-on: ubuntu-latest
167159
timeout-minutes: 30

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cyclonedx/cyclonedx-library",
3-
"version": "10.0.1-alpha.1",
3+
"version": "10.0.1-alpha.2",
44
"description": "Core functionality of CycloneDX for JavaScript (Node.js or WebBrowser).",
55
"license": "Apache-2.0",
66
"keywords": [

0 commit comments

Comments
 (0)