Skip to content

Commit

Permalink
fix: add github actions, auto release & dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Dec 8, 2023
1 parent cdbdb3e commit c401310
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
commit-message:
prefix: 'chore'
include: 'scope'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
commit-message:
prefix: 'chore'
include: 'scope'
60 changes: 60 additions & 0 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test & Maybe Release
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
node: [18.x, 20.x, lts/*]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: |
npm install --no-progress
- name: Run tests
run: |
npm test
release:
name: Release
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4.0.0
with:
node-version: lts/*
- name: Install dependencies
run: |
npm install --no-progress --no-package-lock --no-save
- name: Build
run: |
npm run build
- name: Install plugins
run: |
npm install \
@semantic-release/commit-analyzer \
conventional-changelog-conventionalcommits \
@semantic-release/release-notes-generator \
@semantic-release/npm \
@semantic-release/github \
@semantic-release/git \
@semantic-release/changelog \
--no-progress --no-package-lock --no-save
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

86 changes: 84 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "ghauth.js",
"scripts": {
"lint": "standard *.js",
"test": "npm run lint && echo 'no tests to run'"
"test": "npm run lint && echo 'no tests to run'",
"build": "true"
},
"repository": {
"type": "git",
Expand All @@ -30,6 +31,87 @@
"read": "^1.0.7"
},
"devDependencies": {
"standard": "~14.3.1"
"standard": "^17.1.0"
},
"release": {
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "chore",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"scope": "no-release",
"release": false
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"section": "Trivial Changes"
},
{
"type": "docs",
"section": "Trivial Changes"
},
{
"type": "test",
"section": "Tests"
}
]
}
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
}

0 comments on commit c401310

Please sign in to comment.