diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef1f710..e86f60e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [ push ] +on: [ push, workflow_call ] jobs: build-test: @@ -19,7 +19,8 @@ jobs: version: 'latest' run_install: true - - run: pnpm test + - name: Run Tests + run: pnpm test - name: Prettify package.json run: ./node_modules/.bin/prettier-package-json --use-tabs --list-different diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ec578f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release version to npm + +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + ci: + uses: "./.github/workflows/ci.yml" + deploy: + name: deploy + needs: [ci] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18' + + - uses: pnpm/action-setup@v3 + with: + version: 'latest' + run_install: true + + - name: Set version number in package.json + run: pnpm version from-git --no-git-tag-version + + - name: Publish package + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index eee2e62..6793284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ===== * (bug) Revert CSS Reset back to no longer use `:where()`. +* (internal) Add automatic package publishing. 2.0.0 diff --git a/package.json b/package.json index 79a3f55..f2d7da3 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,11 @@ }, "publishConfig": { "access": "public", - "publish-branch": "1.x" + "publish-branch": "2.x" }, "ava": { "files": [ "tests/**/*.test.mjs" ] - }, - "np": { - "branch": "1.x", - "contents": "dist" } }