Skip to content

Commit

Permalink
Merge pull request #4 from rastislavcore/update/cicd-01
Browse files Browse the repository at this point in the history
CI/CD improvements
  • Loading branch information
sergical authored Dec 22, 2024
2 parents e15aed6 + 7335f4b commit 777ba93
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3,635 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @sergical will be requested for review when someone
# @sergical will be requested for review when someone
# opens a pull request.
* @sergical

Expand All @@ -15,4 +15,4 @@ pnpm-lock.yaml @sergical
/src/__tests__/ @sergical

# GitHub specific files
/.github/ @sergical
/.github/ @sergical
39 changes: 0 additions & 39 deletions .github/dependabot.yml

This file was deleted.

38 changes: 2 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm install --no-frozen-lockfile

- name: Lint
run: pnpm lint
Expand Down Expand Up @@ -60,10 +59,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm install --no-frozen-lockfile

- name: Generate coverage report
run: pnpm test:coverage
Expand All @@ -72,35 +70,3 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

publish:
needs: [test, coverage]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.10.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Publish to npm
if: success()
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to NPM

on:
release:
types: [created]

permissions:
id-token: write
contents: write

jobs:
build-and-publish:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8.10.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Build
run: pnpm build

- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ coverage/
*.tsbuildinfo

# Test coverage
coverage/
coverage/

# Esbuild visualizer
esbuild-why-cjs.html
esbuild-why-esm.html
esbuild-why-esm.html

# Lock files
pnpm-lock.yaml
yarn.lock
package-lock.json
Loading

0 comments on commit 777ba93

Please sign in to comment.