Skip to content

Commit

Permalink
chore: add release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
bukowa committed Jul 8, 2024
1 parent fbf440c commit c24f27b
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions .github/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
61 changes: 61 additions & 0 deletions .github/workflows/npm-publish-package.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
49 changes: 49 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions selenium/javascript/LICENSE
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit c24f27b

Please sign in to comment.