diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 0000000..386fe06 --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,30 @@ +name: release +on: + push: + branches: [master] + +jobs: + release: + name: Release + permissions: + id-token: write # to enable NPM provenance + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "18" + + - name: Install semantic-release + run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog conventional-changelog-conventionalcommits @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator @semantic-release/npm + + - name: Publish to NPM + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..dc934ac --- /dev/null +++ b/.releaserc @@ -0,0 +1,68 @@ +{ + "branches": [ + "master", + "next" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "docs", + "release": "patch" + }, + { + "type": "refactor", + "release": "patch" + }, + { + "type": "style", + "release": "patch" + }, + { + "type": "ci", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "build", + "release": "patch" + }, + { + "type": "chore", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/changelog", + { + "changelogTitle": "# passport-keycloak-jwt-introspect - Changelog" + } + ], + "@semantic-release/github", + "@semantic-release/npm", + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "package.json" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} \ No newline at end of file