From 1ac6d008d4118ce9777f21f67f0c3f367bc9c2e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Mar 2026 17:36:27 +0100 Subject: [PATCH 1/2] chore: Adjust workflows to not use docker build anymore + publish to github pages --- .github/workflows/pull-request.yaml | 29 ++++++---- .github/workflows/push-master.yaml | 86 +++++++++++++++++++++++------ CLAUDE.md | 5 ++ 3 files changed, 93 insertions(+), 27 deletions(-) create mode 100644 CLAUDE.md diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 2219c65..c13b692 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -1,6 +1,10 @@ name: pull request ci on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: ci: name: ci @@ -9,17 +13,20 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - run: | - docker build . --target=test-components -t zvoove-angular-components:test-comp - docker build . --target=test-schematics -t zvoove-angular-components:test-schem - docker build . --target=linter -t zvoove-angular-components:lint - name: build ci images + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + + - name: Install dependencies + run: npm ci - - run: docker run --rm zvoove-angular-components:lint - name: run linter + - name: Lint + run: npm run lint - - run: docker run --rm zvoove-angular-components:test-comp - name: test components + - name: Test components + run: npm run test:components - - run: docker run --rm zvoove-angular-components:test-schem - name: test schematics + - name: Test schematics + run: npm run test:schematics diff --git a/.github/workflows/push-master.yaml b/.github/workflows/push-master.yaml index 2b7b86a..5aa10f1 100644 --- a/.github/workflows/push-master.yaml +++ b/.github/workflows/push-master.yaml @@ -4,12 +4,17 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + permissions: - id-token: write # Required for OIDC + id-token: write contents: read jobs: - deploy: + ci: + name: ci runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,25 +22,74 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 24 - registry-url: 'https://registry.npmjs.org' + cache: npm + + - run: npm ci - - run: | - docker build . --target=test-components -t zvoove-angular-components:test-comp - docker build . --target=test-schematics -t zvoove-angular-components:test-schem - docker build . --target=linter -t zvoove-angular-components:lint - name: build ci images + - name: Lint + run: npm run lint - - run: docker run --rm zvoove-angular-components:lint - name: run linter + - name: Test components + run: npm run test:components - - run: docker run --rm zvoove-angular-components:test-comp - name: test components + - name: Test schematics + run: npm run test:schematics - - run: docker run --rm zvoove-angular-components:test-schem - name: test schematics - - run: npm ci + - name: Build components + run: npm run build:components + + - name: Build demo + run: npm run build:components-demo -- --base-href /components/ + + - name: Upload components artifact + uses: actions/upload-artifact@v4 + with: + name: components-dist + path: dist/components + + - name: Upload demo artifact + uses: actions/upload-pages-artifact@v3 + with: + path: dist/zvoove-components-demo/browser + + publish: + name: publish to npm + needs: ci + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: 'https://registry.npmjs.org' - - run: npm run build:components + - name: Download components artifact + uses: actions/download-artifact@v4 + with: + name: components-dist + path: dist/components + + - name: Check if version already published + id: version-check + run: | + LOCAL=$(node -p "require('./dist/components/package.json').version") + REMOTE=$(npm view @zvoove/components version 2>/dev/null || echo "0.0.0") + echo "should_publish=$( [ "$LOCAL" != "$REMOTE" ] && echo true || echo false )" >> "$GITHUB_OUTPUT" - name: Publish to npm + if: steps.version-check.outputs.should_publish == 'true' run: npm publish ./dist/components --provenance --access public + + deploy-demo: + name: deploy demo to github pages + needs: ci + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..67fbe9d --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +# CLAUDE.md + +## npm Publishing with Trusted Publishers + +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. From c5bdc6dbe4764f0031ce695124c1a9e044136719 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Mar 2026 17:38:05 +0100 Subject: [PATCH 2/2] remove dockerfile --- Dockerfile | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index de8b29c..0000000 --- a/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM docker.io/library/node:25.6-alpine AS prepare - -RUN apk add chromium -ENV CHROME_BIN=/usr/bin/chromium-browser -ENV CI=true - -FROM prepare AS build -WORKDIR /app/src -COPY package*.json ./ -RUN npm ci --no-audit -COPY . ./ - -FROM build AS test-components - -ENTRYPOINT ["npm", "run", "test:components"] - -FROM build AS test-schematics -ENTRYPOINT ["npm", "run", "test:schematics"] - -FROM build AS linter -ENTRYPOINT ["npm", "run", "lint"] - -FROM build AS build-demo -RUN npm run build:components-demo -- --output-path=./dist/out - -FROM docker.io/library/node:25.6-alpine -WORKDIR /usr/app -COPY --from=build-demo /app/src/dist/out ./ - -# with this the server runs unprivileged -USER node -CMD node server/server.mjs -EXPOSE 8080