Skip to content

Commit

Permalink
Add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Sep 9, 2024
1 parent 07030ab commit 2b050c1
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linting

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linting:
name: "Linting"
uses: SocketDev/workflows/.github/workflows/reusable-base.yml@master
with:
no-lockfile: true
npm-test-script: 'check'
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
uses: SocketDev/workflows/.github/workflows/reusable-base.yml@master
with:
no-lockfile: true
npm-test-script: 'test-ci'
node-versions: '20'
# We currently have some issues on Windows that will have to wait to be fixed
# os: 'ubuntu-latest,windows-latest'
os: 'ubuntu-latest'
27 changes: 27 additions & 0 deletions .github/workflows/provenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Package to npmjs

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: npm
scope: "@socketsecurity"
- run: npm install -g npm@latest
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Type Checks

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
schedule:
- cron: '14 5 * * 1,3,5'

permissions:
contents: read

jobs:
type-check:
uses: SocketDev/workflows/.github/workflows/type-check.yml@master
with:
no-lockfile: true
ts-versions: ${{ github.event.schedule && 'next' || '5.4,next' }}
ts-libs: 'esnext'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"prepare": "husky",
"test": "run-s check test:*",
"test:unit": "tap",
"test-ci": "run-s build:* test:*",
"update": "run-p -c --aggregate-output update:*",
"update:npm:package-json": "node ./scripts/update-npm-package-json.js",
"update:manifest": "node ./scripts/update-manifest.js"
Expand Down

0 comments on commit 2b050c1

Please sign in to comment.