Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/cd.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is mostly just reorganizing things so I could create a dedicated workflow for Trusted Publishing to NPM so we don't need to use an NPM token secret.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CD

on:
release:
types: [released]

permissions:
contents: read
id-token: write # Required to authenticate with npm

jobs:
docs:
uses: ./.github/workflows/docs.yml
secrets: inherit
with:
deploy: true

publish:
environment: npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: lts
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish
22 changes: 15 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
name: Docs Deployment

on:
pull_request:
push:
branches:
- develop
release:
types: [released]
workflow_dispatch:
inputs:
deploy:
description: "Deploy to GitHub Pages"
required: true
type: boolean
default: false

workflow_call:
inputs:
deploy:
description: "Deploy to GitHub Pages"
required: true
type: boolean
default: false

jobs:
build:
Expand Down Expand Up @@ -39,7 +47,7 @@ jobs:
# pages and id-token required to deploy to GitHub Pages
pages: write
id-token: write
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
if: inputs.deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ jobs:

- name: Run tests
run: npm test

docs:
uses: ./.github/workflows/docs.yml
secrets: inherit
with:
deploy: false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "roslib",
"homepage": "https://robotwebtools.github.io",
"description": "The standard ROS Javascript Library",
"version": "2.0.0",
"version": "2.0.0-alpha1",
"license": "BSD-2-Clause",
"files": [
"dist"
Expand Down