ci: add publish workflow

This commit is contained in:
Luke Bennett 2021-06-13 03:18:43 +01:00
parent dc1285d742
commit 80f106c113
No known key found for this signature in database
GPG key ID: A738E9C68D3BF31A
7 changed files with 3236 additions and 41 deletions

35
.github/workflows/publish.yaml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Publish
on:
push:
branches:
- stable
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '15.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --no-progress
- run: yarn build
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '15.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@simplestream'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --no-progress
- run: yarn release

1
.husky/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
_

4
.husky/commit-msg Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx commitlint -E HUSKY_GIT_PARAMS

1
commitlint.config.js Normal file
View file

@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };

View file

@ -11,11 +11,13 @@
"license": "MIT",
"private": false,
"scripts": {
"prepare": "husky install",
"clean": "rm -rf dist",
"build": "npm run clean && tsc",
"dev": "npm run clean && npm run build -- --watch",
"format": "prettier --write 'src/**/*'",
"test": "jest"
"test": "jest",
"release": "semantic-release"
},
"dependencies": {
"axios": "^0.21.1",
@ -25,10 +27,16 @@
"@babel/core": "^7.14.5",
"@babel/preset-env": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^26.0.23",
"babel-jest": "^27.0.2",
"husky": "^6.0.0",
"jest": "^27.0.4",
"prettier": "^2.3.1",
"semantic-release": "^17.4.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"

31
release.config.js Normal file
View file

@ -0,0 +1,31 @@
module.exports = {
branches: ['stable'],
plugins: {
commitAnalyzer: [
'@semantic-release/commit-analyzer',
{
releaseRules: [
{ type: 'style', release: 'patch' },
{ type: 'chore', release: 'patch' },
{ type: 'docs', release: 'patch' },
],
},
],
releaseNotes: '@semantic-release/release-notes-generator',
changelog: [
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
changelogTitle: '# CHANGELOG',
},
],
github: '@semantic-release/github',
npm: '@semantic-release/npm',
git: [
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json'],
},
],
},
};

3195
yarn.lock

File diff suppressed because it is too large Load diff