diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml deleted file mode 100644 index 3b54f1d..0000000 --- a/.github/workflows/release-package.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: read - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16.18 - registry-url: 'https://npm.pkg.github.com' - - run: npm install - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - run: npm ci - - run: npm test - - publish-gpr: - needs: build - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16.18 - registry-url: https://npm.pkg.github.com/ - - run: npm install - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - run: npm ci - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c917537 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,44 @@ +name: Release Please and Publish + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + packages: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + # The logic below handles the package building: + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v4 + with: + node-version: 18.18 + registry-url: 'https://npm.pkg.github.com' + if: ${{ steps.release.outputs.release_created }} + - run: npm install + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm test + if: ${{ steps.release.outputs.release_created }} + # The logic below handles the package building: + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + if: ${{ steps.release.outputs.release_created }} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..d1b4f20 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "release-type": "node", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "draft": false, + "prerelease": false + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +}