From cfa138bd20f96e95b822c1163bf807b4ad78f145 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Fri, 22 Jul 2022 15:10:05 -0400 Subject: [PATCH] chore: Adding release plz (#98) Adding release plz Signed-off-by: Todd Baert --- .github/workflows/release-please.yml | 42 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 30 -------------------- .release-please-manifest.json | 1 + release-please-config.json | 13 +++++++++ 4 files changed, 56 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/release-please.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 000000000..ada3fe576 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,42 @@ +on: + push: + branches: + - main +name: Run Release Please +jobs: + release-please: + runs-on: ubuntu-latest + + # Release-please creates a PR that tracks all changes + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + command: manifest + token: ${{secrets.GITHUB_TOKEN}} + default-branch: main + + # The logic below handles the npm publication: + - name: Checkout Repository + if: ${{ steps.release.outputs.releases_created }} + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v3 + if: ${{ steps.release.outputs.releases_created }} + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - name: Build Packages + if: ${{ steps.release.outputs.releases_created }} + run: | + npm ci + npm run build + + # Release Please has already incremented versions and published tags, so we just + # need to publish all unpublished versions to NPM here + # Our scripts only publish versions that do not already exist. + - name: Publish to NPM + if: ${{ steps.release.outputs.releases_created }} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + run: npm run publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 133205185..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: release - -on: - push: - # run only against tags prefixed with v - tags: - - 'v*' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GIT_PUSH }} # use a custom PAT of a user with allows branch-protection bypass - - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - - - name: Install - run: npm ci - - - name: Build - run: npm run build - - - name: Publish - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..bebe4b845 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "bootstrap-sha": "9ec6555fb0a9144a70020e52d8c718c8424db225", + "packages": { + ".": { + "releaseType": "node", + "prerelease": false, + "bumpMinorPreMajor": false, + "bumpPatchForMinorPreMajor": false, + "changelogPath": "CHANGELOG.md", + "versioning": "default" + } + } +} \ No newline at end of file