diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d38bc13 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +# config borrowed from: https://docs.npmjs.com/trusted-publishers#github-actions-configuration +name: Release package + +on: + push: + tags: + - "v*.*.*" + +permissions: + id-token: write # Required for OIDC + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Use Node.js 22.x + uses: actions/setup-node@v6 + with: + node-version: 22.x + cache: 'npm' + + - run: npm version ${{ github.ref_name }} --no-git-tag-version + + - run: npm install + + - run: npm test + + - run: npm pack + + - run: npm publish + + - name: Release + if: ${{ always() }} + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: | + ./doctoc-*.tgz diff --git a/package-lock.json b/package-lock.json index f5678ad..68448f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "doctoc", - "version": "2.2.0", + "version": "0.0.0-development", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "2.2.0", + "version": "0.0.0-development", "license": "MIT", "dependencies": { "@textlint/markdown-to-ast": "^12.1.1", diff --git a/package.json b/package.json index e907f82..97b1901 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Thorsten Lorenz (thlorenz.com)", "name": "doctoc", "description": "Generates TOC for markdown files of local git repo.", - "version": "2.2.0", + "version": "0.0.0-development", "repository": { "type": "git", "url": "git://github.com/thlorenz/doctoc.git"