From c24f27bc658454fa0f26e6a1f0c4b07253cb43a0 Mon Sep 17 00:00:00 2001 From: Bukowa Date: Mon, 8 Jul 2024 15:48:39 +0200 Subject: [PATCH] chore: add release-please --- .github/release-please-config.json | 93 ++++++++++++++++++++++ .github/release-please-manifest.json | 1 + .github/workflows/npm-publish-package.yaml | 61 ++++++++++++++ .github/workflows/release-please.yaml | 49 ++++++++++++ package-lock.json | 1 + selenium/javascript/LICENSE | 21 +++++ 6 files changed, 226 insertions(+) create mode 100644 .github/release-please-config.json create mode 100644 .github/release-please-manifest.json create mode 100644 .github/workflows/npm-publish-package.yaml create mode 100644 .github/workflows/release-please.yaml create mode 100644 selenium/javascript/LICENSE diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 0000000..b649053 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,93 @@ +{ + "initial-version": "0.1.0", + "include-component-in-tag": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "plugins": [ + "sentence-case", + { + "type": "node-workspace", + "merge": false, + "groupName": "js", + "updatePeerDependencies": true, + "components": [ + "@tauri-e2e/selenium" + ] + } + ], + "packages": { + "selenium/javascript": { + "component": "@tauri-e2e/selenium", + "release-type": "node", + "changelog-path": "CHANGELOG.md" + } + }, + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "feature", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "docs", + "section": "Documentation", + "hidden": true + }, + { + "type": "style", + "section": "Styles", + "hidden": true + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": true + }, + { + "type": "refactor", + "section": "Code Refactoring", + "hidden": true + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System", + "hidden": true + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + }, + { + "type": "deps", + "section": "Dependencies", + "hidden": true + }, + { + "type": "tools", + "section": "Tools", + "hidden": true + } + ], + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} diff --git a/.github/release-please-manifest.json b/.github/release-please-manifest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.github/release-please-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.github/workflows/npm-publish-package.yaml b/.github/workflows/npm-publish-package.yaml new file mode 100644 index 0000000..9cbb0be --- /dev/null +++ b/.github/workflows/npm-publish-package.yaml @@ -0,0 +1,61 @@ +name: "Node: Publish NPM Package" +on: + workflow_dispatch: + inputs: + package: + type: string + description: 'Package to publish' + required: true + tag: + type: string + description: 'Tag to publish' + required: true + + workflow_call: + inputs: + package: + type: string + description: 'Package to publish' + required: true + tag: + type: string + description: 'Tag to publish' + required: true + secrets: + NPM_REGISTRY_TOKEN: + description: 'Token for publishing NPM packages' + required: true + +jobs: + + publish-npm-package: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + with: + ref: ${{ inputs.tag }} + fetch-tags: true + + - name: Setup Node + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} + with: + node-version: 22.2.0 + registry-url: 'https://registry.npmjs.org' + + - name: Install Dependencies + run: | + npm install --loglevel verbose + + - name: Build Package + run: | + npm run --workspace=${{ inputs.package }} build + + - name: Publish Package + run: | + npm publish \ + --access public \ + --provenance \ + --workspace ${{ inputs.package }} diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..dfc4d3c --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,49 @@ +on: + push: + branches: + - master + workflow_dispatch: + +name: "Release Please" + +jobs: + + release-please: + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + outputs: + selenium/javascript--id: ${{ steps.release-please.outputs['selenium/javascript--id'] }} + selenium/javascript--tag: ${{ steps.release-please.outputs['selenium/javascript--tag_name'] }} + selenium/javascript--created: ${{ steps.release-please.outputs['selenium/javascript--release_created'] }} + + steps: + - uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4 + id: release-please + with: + token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + config-file: '.github/release-please-config.json' + manifest-file: '.github/.release-please-manifest.json' + + - run: | + echo '${{ toJSON(steps.release-please.outputs) }}' + + release-please-output: + runs-on: ubuntu-latest + steps: + - run: | + echo '${{ toJSON(needs.release-please.outputs) }}' + needs: [ release-please ] + + publish-npm: + needs: [ release-please ] + if: ${{ needs.release-please.outputs['selenium/javascript--created'] }} + uses: "./.github/workflows/npm-publish-package.yaml" + with: + package: 'selenium/javascript' + tag: ${{ needs.release-please.outputs['selenium/javascript--tag'] }} + secrets: + NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 0eec0ee..fe77361 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2307,6 +2307,7 @@ "selenium/javascript": { "name": "@tauri-e2e/selenium", "version": "0.0.0", + "license": "MIT", "dependencies": { "find-cache-dir": "^5.0.0", "selenium-webdriver": "^4.22.0" diff --git a/selenium/javascript/LICENSE b/selenium/javascript/LICENSE new file mode 100644 index 0000000..f7664e7 --- /dev/null +++ b/selenium/javascript/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Mateusz Kurowski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.