Skip to content

Commit 560728b

Browse files
saithisclaude
andauthored
chore: Adjust workflows to not use docker build anymore + publish to … (#54)
* chore: Adjust workflows to not use docker build anymore + publish to github pages * remove dockerfile --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 43ba2dc commit 560728b

File tree

4 files changed

+93
-60
lines changed

4 files changed

+93
-60
lines changed
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: pull request ci
22
on: [pull_request]
33

4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
48
jobs:
59
ci:
610
name: ci
@@ -9,17 +13,20 @@ jobs:
913
- name: Checkout
1014
uses: actions/checkout@v4
1115

12-
- run: |
13-
docker build . --target=test-components -t zvoove-angular-components:test-comp
14-
docker build . --target=test-schematics -t zvoove-angular-components:test-schem
15-
docker build . --target=linter -t zvoove-angular-components:lint
16-
name: build ci images
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 24
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
1724

18-
- run: docker run --rm zvoove-angular-components:lint
19-
name: run linter
25+
- name: Lint
26+
run: npm run lint
2027

21-
- run: docker run --rm zvoove-angular-components:test-comp
22-
name: test components
28+
- name: Test components
29+
run: npm run test:components
2330

24-
- run: docker run --rm zvoove-angular-components:test-schem
25-
name: test schematics
31+
- name: Test schematics
32+
run: npm run test:schematics

.github/workflows/push-master.yaml

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,92 @@ on:
44
branches:
55
- master
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: false
10+
711
permissions:
8-
id-token: write # Required for OIDC
12+
id-token: write
913
contents: read
1014

1115
jobs:
12-
deploy:
16+
ci:
17+
name: ci
1318
runs-on: ubuntu-latest
1419
steps:
1520
- uses: actions/checkout@v4
1621

1722
- uses: actions/setup-node@v4
1823
with:
1924
node-version: 24
20-
registry-url: 'https://registry.npmjs.org'
25+
cache: npm
26+
27+
- run: npm ci
2128

22-
- run: |
23-
docker build . --target=test-components -t zvoove-angular-components:test-comp
24-
docker build . --target=test-schematics -t zvoove-angular-components:test-schem
25-
docker build . --target=linter -t zvoove-angular-components:lint
26-
name: build ci images
29+
- name: Lint
30+
run: npm run lint
2731

28-
- run: docker run --rm zvoove-angular-components:lint
29-
name: run linter
32+
- name: Test components
33+
run: npm run test:components
3034

31-
- run: docker run --rm zvoove-angular-components:test-comp
32-
name: test components
35+
- name: Test schematics
36+
run: npm run test:schematics
3337

34-
- run: docker run --rm zvoove-angular-components:test-schem
35-
name: test schematics
36-
- run: npm ci
38+
- name: Build components
39+
run: npm run build:components
40+
41+
- name: Build demo
42+
run: npm run build:components-demo -- --base-href /components/
43+
44+
- name: Upload components artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: components-dist
48+
path: dist/components
49+
50+
- name: Upload demo artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: dist/zvoove-components-demo/browser
54+
55+
publish:
56+
name: publish to npm
57+
needs: ci
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/setup-node@v4
61+
with:
62+
node-version: 24
63+
registry-url: 'https://registry.npmjs.org'
3764

38-
- run: npm run build:components
65+
- name: Download components artifact
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: components-dist
69+
path: dist/components
70+
71+
- name: Check if version already published
72+
id: version-check
73+
run: |
74+
LOCAL=$(node -p "require('./dist/components/package.json').version")
75+
REMOTE=$(npm view @zvoove/components version 2>/dev/null || echo "0.0.0")
76+
echo "should_publish=$( [ "$LOCAL" != "$REMOTE" ] && echo true || echo false )" >> "$GITHUB_OUTPUT"
3977
4078
- name: Publish to npm
79+
if: steps.version-check.outputs.should_publish == 'true'
4180
run: npm publish ./dist/components --provenance --access public
81+
82+
deploy-demo:
83+
name: deploy demo to github pages
84+
needs: ci
85+
runs-on: ubuntu-latest
86+
permissions:
87+
pages: write
88+
id-token: write
89+
environment:
90+
name: github-pages
91+
url: ${{ steps.deployment.outputs.page_url }}
92+
steps:
93+
- name: Deploy to GitHub Pages
94+
id: deployment
95+
uses: actions/deploy-pages@v4

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CLAUDE.md
2+
3+
## npm Publishing with Trusted Publishers
4+
5+
npm supports trusted publishers (OIDC-based publishing) via GitHub Actions. When a package is configured with trusted publishers on npmjs.com, the `id-token: write` permission + `actions/setup-node` with `registry-url` is sufficient for `npm publish --provenance`. No `NODE_AUTH_TOKEN` secret is needed. Do not flag missing `NODE_AUTH_TOKEN` as a defect when `id-token: write` is present and `--provenance` is used.

Dockerfile

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

0 commit comments

Comments
 (0)