Skip to content

Commit

Permalink
v2 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
szilanor committed Jul 27, 2024
1 parent 9496e01 commit 6ca059e
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 84 deletions.
84 changes: 0 additions & 84 deletions .github/workflows/ci.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint and test

on:
pull_request:

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: |
npm ci --ignore-scripts
- name: Lint code
run: |
npm run lint
- name: Run tests
run: |
npm test
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish

on:
workflow_dispatch:
inputs:
version:
type: choice
options:
- major
- minor
- patch

permissions:
contents: write

jobs:
build:
environment: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: |
npm ci --ignore-scripts
- name: Build
run: |
npm run build
- name: Update version and docs
run: |
git reset --hard
git config --local --list
git checkout main
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
npm version ${{ inputs.version }}
npm run docs
git add . || true
git commit -m "Update package version and docs" || true
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" -f
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"scripts": {
"build": "tsup",
"docs": "npx typedoc src/index.ts",
"format": "prettier --write src/",
"lint": "npm run lint:eslint && npm run lint:prettier",
"lint:eslint": "eslint --report-unused-disable-directives src/",
Expand Down

0 comments on commit 6ca059e

Please sign in to comment.