Skip to content

Commit 0b5f7a4

Browse files
authored
chore: updated workflows, changelog (#115)
1 parent a10adc0 commit 0b5f7a4

File tree

3 files changed

+50
-32
lines changed

3 files changed

+50
-32
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,10 @@ jobs:
3434
- name: Checkout repository
3535
uses: actions/checkout@v4
3636

37-
- name: Log ENV_MODE
38-
run: 'echo "ENV_MODE is set to: $ENV_MODE"'
39-
40-
- name: Setup Node.js
37+
- name: Set up Node.js
4138
uses: actions/setup-node@v4
4239
with:
43-
node-version: lts/*
44-
check-latest: true
40+
node-version: 24
4541
cache: npm
4642
cache-dependency-path: package-lock.json
4743

@@ -79,16 +75,15 @@ jobs:
7975
- name: Build Node.js project
8076
run: npm run build
8177

82-
# Remove build artifacts to avoid publishing them
83-
- name: Clean build directory
84-
run: rm -rf build/
78+
# Create Git archive of version-controlled files
79+
- name: Create clean source archive
80+
run: git archive --format=tar.gz --output=clean-source.tar.gz HEAD
8581

86-
# Upload clean source code
87-
- name: Upload repository artifacts
82+
- name: Upload source archive
8883
uses: actions/upload-artifact@v4
8984
with:
90-
name: repo-artifacts
91-
path: ./
85+
name: clean-source
86+
path: clean-source.tar.gz
9287

9388
publish-npmjs:
9489
needs: build
@@ -97,22 +92,33 @@ jobs:
9792
ENV_MODE: ci
9893

9994
steps:
100-
- name: Log ENV_MODE
101-
run: 'echo "ENV_MODE is set to: $ENV_MODE"'
102-
103-
- name: Download repository artifacts
95+
- name: Download clean source archive
10496
uses: actions/download-artifact@v4
10597
with:
106-
name: repo-artifacts
98+
name: clean-source
10799
path: ./
108100

101+
- name: Extract source archive
102+
run: tar -xzf clean-source.tar.gz
103+
104+
- name: Remove extracted source archive
105+
run: rm clean-source.tar.gz
106+
109107
- name: Set up Node.js for npmjs
110108
uses: actions/setup-node@v4
111109
with:
112-
node-version: lts/*
113-
check-latest: true
110+
node-version: 24
114111
registry-url: https://registry.npmjs.org/
115112
cache: npm
113+
cache-dependency-path: package-lock.json
114+
115+
- name: Upgrade npm
116+
run: |
117+
corepack enable
118+
npm install -g npm@11.4.1
119+
120+
- name: Install Node.js dependencies
121+
run: npm ci
116122

117123
- name: Set up Git user
118124
run: |
@@ -142,22 +148,33 @@ jobs:
142148
ENV_MODE: ci
143149

144150
steps:
145-
- name: Log ENV_MODE
146-
run: 'echo "ENV_MODE is set to: $ENV_MODE"'
147-
148-
- name: Download repository artifacts
151+
- name: Download clean source archive
149152
uses: actions/download-artifact@v4
150153
with:
151-
name: repo-artifacts
154+
name: clean-source
152155
path: ./
153156

154-
- name: Setup Node.js for GPR
157+
- name: Extract source archive
158+
run: tar -xzf clean-source.tar.gz
159+
160+
- name: Remove extracted source archive
161+
run: rm clean-source.tar.gz
162+
163+
- name: Set up Node.js for GPR
155164
uses: actions/setup-node@v4
156165
with:
157-
node-version: lts/*
158-
check-latest: true
166+
node-version: 24
159167
registry-url: https://npm.pkg.github.com/
160168
cache: npm
169+
cache-dependency-path: package-lock.json
170+
171+
- name: Upgrade npm
172+
run: |
173+
corepack enable
174+
npm install -g npm@11.4.1
175+
176+
- name: Install Node.js dependencies
177+
run: npm ci
161178

162179
- name: Set up Git user
163180
run: |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# .github/workflows/publish.yml
1+
# .github/workflows/publish-test.yml
22
#
33
# Copyright © 2025 Network Pro Strategies (Network Pro™)
44
# SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
55
# This file is part of Network Pro
66

7-
name: Publish to Registries
7+
name: Test Publishing to Registries
88

99
on:
1010
workflow_dispatch:

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ This project attempts to follow [Keep a Changelog](https://keepachangelog.com/en
2828

2929
- Updated Node.js engine to `24` to match the specified engine constraints in `package.json`.
3030
- Reordered `npm ci` step to follow Node.js and npm setup to prevent version mismatches during simulation steps.
31-
- Version bumped to **v1.14.1**
31+
- Refactored `build-and-publish.yml` to use `git archive` for artifact preparation and aligned it with a tested publishing flow.
32+
- Removed `.npmrc` token-based authentication in favor of environment secrets to avoid credential conflicts.
3233

3334
### Added
3435

35-
- Introduced `.github/workflows/publish.yml`, a separate dry-run simulation workflow for testing `npm publish` without deploying to registries.
36+
- Introduced `.github/workflows/publish-test.yml`, a standalone workflow to safely simulate `npm publish` without publishing.
3637
- Added commands to display Node.js and npm versions for visibility and troubleshooting in all relevant jobs.
3738

3839
---

0 commit comments

Comments
 (0)