Skip to content

Commit

Permalink
ci(release-please): setup release-please
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk de Visser <[email protected]>
  • Loading branch information
dirkdev98 committed May 20, 2024
1 parent 35f416d commit da30fb0
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 4 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
push:
branches:
- main

permissions:
id-token: write
contents: write
pull-requests: write

name: release-please

jobs:
release:
runs-on: ubuntu-latest
outputs:
paths_released: ${{ steps.rp_step.outputs.paths_released }}
releases_created: ${{ steps.rp_step.outputs.releases_created }}
steps:
- uses: googleapis/release-please-action@v4
id: rp_step
with:
# Expires ~December 2024
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
config-file: release-please-config.json
manifest-file: release-please-manifest.json

publish:
needs:
- release
if: ${{ needs.release.outputs.releases_created }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: ${{ fromJson(needs.release.outputs.paths_released) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
# Can't cache, since we don't commit the lockfile
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: |
npm install
- name: Build
run: |
npm run build:ws
- name: Publish
env:
# Expires ~December 2024
# Uses NODE_AUTH_TOKEN which is supported by actions/setup-node
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
cd ${{ matrix.path }}
npm publish --provenance --access public
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"type": "module",
"license": "MIT",
"publishConfig": {
"access": "public"
"bugs": {
"url": "https://github.com/lightbasenl/platforms/issues"
},
"exports": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions packages/pull-through-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"type": "module",
"license": "MIT",
"publishConfig": {
"access": "public"
"bugs": {
"url": "https://github.com/lightbasenl/platforms/issues"
},
"exports": {
".": {
Expand Down
16 changes: 16 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"bootstrap-sha": "35f416dd883667db7c44199bd3b15fb2655857cf",
"release-type": "node",
"packages": {
"packages/eslint-config": {},
"packages/pull-through-cache": {}
},
"plugins": [
{
"type": "node-workspace"
},
{
"type": "sentence-case"
}
]
}
4 changes: 4 additions & 0 deletions release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages/eslint-config": "0.0.1",
"packages/pull-through-cache": "0.0.1"
}

0 comments on commit da30fb0

Please sign in to comment.