Skip to content

Commit

Permalink
chore: add pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Reining <[email protected]>
  • Loading branch information
lukas-reining committed Sep 6, 2024
1 parent 6ca2b0e commit 631bff2
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pr-checks
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
jobs:
build-test-lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 18.x
- 20.x
- 22.x
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
name: release-please

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
steps:
- name: Release please
uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
- name: Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- name: Setup Node
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install
if: ${{ steps.release.outputs.release_created }}
run: |
npm ci
- name: Build
if: ${{ steps.release.outputs.release_created }}
run: |
npm run build
- name: Generate SBOM
if: ${{ steps.release.outputs.release_created }}
run: |
npm sbom --sbom-format=cyclonedx --omit=dev --omit=peer > bom.json
gh release upload ${{ steps.release.outputs.tag_name }} ./bom.json
- name: Publish to NPM
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish
8 changes: 4 additions & 4 deletions example/package-lock.json

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

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"express": "^4.18.2",
"extended-eventsource": "^1.4.9",
"extended-eventsource": "^1.5.1",
"serve-static": "^1.15.0",
"ssestream": "^1.1.0"
}
Expand Down

0 comments on commit 631bff2

Please sign in to comment.