diff --git a/.changeset/config.json b/.changeset/config.json index ad6f18a..b821332 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,7 +4,7 @@ "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.changeset/crisp-wings-drop.md b/.changeset/crisp-wings-drop.md new file mode 100644 index 0000000..3b8ec6c --- /dev/null +++ b/.changeset/crisp-wings-drop.md @@ -0,0 +1,5 @@ +--- +'@luk4x/list': patch +--- + +setup publish workflow diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..380616f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + branches: [main] + +permissions: + contents: write + pull-requests: write + id-token: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.28.2 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: pnpm + registry-url: 'https://registry.npmjs.org' + + - name: Install + run: pnpm install --frozen-lockfile + + - name: Create Release Pull Request or Publish to npm + uses: changesets/action@v1 + with: + version: pnpm -s version-packages + publish: pnpm -s release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 005fe01..63a79b4 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dist", "templates", "index.d.ts", + "CHANGELOG.md", "README.md", "LICENSE" ], @@ -40,16 +41,18 @@ "url": "git+https://github.com/luk4x/list.git" }, "scripts": { + "prepare": "husky", + "changeset": "changeset", + "version-packages": "changeset version", + "release": "changeset publish --provenance", "test": "vitest run", "test:watch": "vitest", "test:types": "tsd && echo \"All type tests passed\"", "test:all": "pnpm test && pnpm test:types", "typecheck": "tsc", "lint": "eslint .", - "prepare": "husky", "dev": "pnpm run build && node ./dist/cli.mjs", - "build": "tsup", - "prepublishOnly": "pnpm build" + "build": "tsup" }, "tsd": { "directory": "tests/type-tests"