From cd401a5e9f9201843670ecabee75a892b5807f1b Mon Sep 17 00:00:00 2001 From: Marian Zeis <13335743+marianfoo@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:30:25 +0100 Subject: [PATCH] chore: add release please (#34) --- .github/workflows/release-please.yml | 37 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- .npmignore | 4 +++ .release-please-manifest.json | 4 +++ package.json | 8 ++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .npmignore create mode 100644 .release-please-manifest.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..5559617 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,37 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + release-type: node + manifest-file: .release-please-manifest.json + # The logic below handles the npm publication: + - uses: actions/checkout@v4 + # these if statements ensure that a publication only occurs when + # a new release is created: + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm install + if: ${{ steps.release.outputs.release_created }} + - run: npm run prepublish + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d984db0..2541f2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: jobs: test: runs-on: ubuntu-latest - if: "github.event.pull_request.title != 'chore: release main'" + if: "!startsWith(github.event.pull_request.title, 'chore(main): release')" strategy: fail-fast: false diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..37e1f55 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +node_modules + +.vscode +.DS_Store diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..5c66571 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "2.1.6" + } + \ No newline at end of file diff --git a/package.json b/package.json index fedf7f9..7bf995f 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,14 @@ "type": "git", "url": "git+https://github.com/geert-janklaps/cds-launchpad-plugin.git" }, + "files": [ + "dist", + "templates", + "cds-plugin.js", + "decs.d.ts", + "LICENSE", + "README.md" + ], "keywords": [ "cds", "cap",