Skip to content

Commit

Permalink
fix(ci): set up semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
kenany committed Jun 9, 2023
1 parent 9e66f33 commit fb7198d
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>kenany/renovate-config"],
"assignees": ["kenany"],
"reviewers": ["kenany"]
"extends": [
"local>kenany/renovate-config",
":assignAndReview(kenany)"
]
}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release
on:
push:
branches:
- master
permissions:
contents: read
jobs:
release:
name: release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
steps:
- uses: actions/setup-node@v3.6.0
with:
node-version: 20
- name: Update npm
run: |
npm install -g npm
npm --version
- uses: actions/checkout@v3.5.3
- name: Install dependencies
uses: bahmutov/npm-install@v1.8.32
with:
useLockFile: false
- run: npm audit signatures
- name: Release
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock = false
provenance = true
12 changes: 12 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/npm",
"@semantic-release/git"
],
"preset": "conventionalcommits",
"tagFormat": "${version}"
}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2015-2022 Kenan Yildirim <https://kenany.me/>
Copyright 2015-2023 Kenan Yildirim <https://kenany.me/>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Calculate the hyperbolic secant of a number.
## Example

``` javascript
var sech = require('sech');
const sech = require('sech');

sech(Math.PI);
// => 0.08626673833405443
Expand All @@ -20,7 +20,7 @@ $ npm install sech
## API

``` javascript
var sech = require('sech');
const sech = require('sech');
```

### `sech(x)`
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
'use strict';

const cosh = require('cosh');

/**
* @param {number} x
* @returns {number}
*/
function sech(x) {
return 1 / cosh(x);
}
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"keywords": [
"math"
],
"repository": "KenanY/sech",
"repository": "github:kenany/sech",
"license": "MIT",
"author": "Kenan Yildirim <kenan@kenany.me> (https://kenany.me/)",
"main": "index.js",
"files": [
"CHANGELOG.md",
"index.js",
"LICENSE.txt"
],
Expand All @@ -22,17 +23,22 @@
"scripts": {
"lint": "eslint *.js test/*.js",
"coverage": "nyc npm test",
"test": "tape test/index.js"
"test": "tape test/index.js",
"release": "semantic-release"
},
"dependencies": {
"cosh": "^1.0.2"
},
"devDependencies": {
"@kenan/eslint-config": "^10.0.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"almost-equal": "^1.1.0",
"conventional-changelog-conventionalcommits": "^6.0.0",
"eslint": "^8.42.0",
"lodash.isfunction": "^3.0.9",
"nyc": "^15.1.0",
"semantic-release": "^21.0.3",
"tape": "^5.6.3"
}
}

0 comments on commit fb7198d

Please sign in to comment.