Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(repo): semver and releasing workflow #1105

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
enabled: true
titleOnly: false
types:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
37 changes: 37 additions & 0 deletions .github/workflows/check-package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check package lock up to date

on:
pull_request:
branches: [main]

jobs:
package-lock-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Setup node cache
id: node-cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: npm-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
restore-keys: npm-

- name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm i

- name: Verify package-lock.json files are up to date
run: |
if ! git status --porcelain; then
echo "::error::Changes detected in git after running 'npm install --package-lock-only'. Please run 'npm install' and commit and push the changes."
git status
exit 1
fi
echo "No changes in package-lock detected."
49 changes: 49 additions & 0 deletions .github/workflows/release-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
pull_request:
# will be checked is merged
types: [closed]
branches:
- main

jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Setup node cache
id: node-cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: npm-${{ hashFiles('package-lock.json') }}-${{ hashFiles('package.json') }}
restore-keys: npm-

- name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm i --include dev

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Run release-it
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_IT_OAUTH_TOKEN }}
1 change: 1 addition & 0 deletions api/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@faims3/config-release-it');
27 changes: 0 additions & 27 deletions api/package-lock.json

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

200 changes: 101 additions & 99 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,100 +1,102 @@
{
"name": "@faims-project/conductor",
"version": "0.1.0",
"private": true,
"main": "build/src/index.js",
"packageManager": "[email protected]",
"scripts": {
"lint": "gts lint",
"clean": "gts clean",
"compile": "tsc",
"build": "tsc",
"fix": "gts fix",
"prestart": "npm run-script compile",
"start": "node .",
"start:prod": "node build/src/index.js",
"local": "env-cmd nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'",
"watch": "nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'",
"initdb": "env-cmd node scripts/initialise.js",
"load-notebooks": "env-cmd node scripts/loadNotebook.js ./notebooks/*.json",
"test": "env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha",
"test:watch": "env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha -w",
"coverage": "nyc --reporter=html --reporter=lcov env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha"
},
"dependencies": {
"archiver": "^6.0.1",
"aws-sdk": "^2.1664.0",
"body-parser": "1.20.2",
"cache-manager": "^5.7.3",
"cookie-session": "2.0.0",
"cors": "2.8.5",
"csv-stringify": "^6.4.4",
"express": "4.19.2",
"express-handlebars": "7.1.2",
"express-rate-limit": "^7.1.5",
"express-validator": "7.0.1",
"faims3-datamodel": "^1.1.6",
"fast-check": "2.25.0",
"gts": "3.1.1",
"handlebars": "4.7.7",
"istanbul": "^0.4.5",
"jose": "^4.15.5",
"markdown-it": "^14.0.0",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"node-cache": "^5.1.2",
"nodemailer": "^6.9.9",
"nyc": "^15.1.0",
"oauth": "0.10.0",
"passport": "^0.7.0",
"passport-google-oauth20": "2.0.0",
"passport-local": "^1.0.0",
"passport-oauth2": "1.7.0",
"pouchdb": "7.3.1",
"pouchdb-find": "8.0.1",
"pouchdb-security-helper": "^2.1.2",
"qrcode": "^1.5.3",
"req-flash": "^0.0.3",
"swagger-ui-dist": "^5.9.1",
"uuid": "9.0.1"
},
"devDependencies": {
"@types/archiver": "^6.0.2",
"@types/chai": "^4.3.9",
"@types/cookie-session": "2.0.47",
"@types/cors": "2.8.17",
"@types/express": "4.17.18",
"@types/express-handlebars": "5.3.1",
"@types/express-session": "1.17.9",
"@types/markdown-it": "^13.0.7",
"@types/mocha": "^10.0.3",
"@types/morgan": "^1.9.5",
"@types/multer": "^1.4.7",
"@types/node": "20.11.19",
"@types/nodemailer": "^6.4.13",
"@types/passport": "^1.0.16",
"@types/passport-google-oauth20": "2.0.13",
"@types/passport-local": "^1.0.35",
"@types/passport-oauth2": "1.4.15",
"@types/pouchdb": "6.4.0",
"@types/qrcode": "^1.5.2",
"@types/sinon": "^10.0.20",
"@types/supertest": "2.0.16",
"@types/swagger-ui-dist": "^3.30.3",
"@types/uuid": "9.0.7",
"chai": "^4.3.10",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"env-cmd": "^10.1.0",
"jest-fast-check": "1.0.2",
"mocha": "^10.2.0",
"nano": "^10.1.2",
"node-fetch": "^3.3.2",
"nodemon": "^2.0.20",
"pouchdb-adapter-memory": "^8.0.1",
"sinon": "^17.0.1",
"supertest": "^6.3.3",
"ts-node": "10.9.1",
"typescript": "^5.5.4"
}
}
"name": "@faims3/api",
"version": "0.0.0",
"private": true,
"main": "build/src/index.js",
"packageManager": "[email protected]",
"scripts": {
"lint": "gts lint",
"clean": "gts clean",
"compile": "tsc",
"build": "tsc",
"fix": "gts fix",
"prestart": "npm run-script compile",
"start": "node .",
"start:prod": "node build/src/index.js",
"local": "env-cmd nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'",
"watch": "nodemon --ignore build --ext ts --exec 'tsc --incremental && node .'",
"initdb": "env-cmd node scripts/initialise.js",
"load-notebooks": "env-cmd node scripts/loadNotebook.js ./notebooks/*.json",
"test": "env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha",
"test:watch": "env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha -w",
"coverage": "nyc --reporter=html --reporter=lcov env-cmd cross-env NODE_ENV=test TS_NODE_PROJECT='./tsconfig.json' mocha",
"release": "release-it --ci"
},
"dependencies": {
"archiver": "^6.0.1",
"aws-sdk": "^2.1664.0",
"body-parser": "1.20.2",
"cache-manager": "^5.7.3",
"cookie-session": "2.0.0",
"cors": "2.8.5",
"csv-stringify": "^6.4.4",
"express": "4.19.2",
"express-handlebars": "7.1.2",
"express-rate-limit": "^7.1.5",
"express-validator": "7.0.1",
"@faims3/data-model": "*",
"fast-check": "2.25.0",
"gts": "3.1.1",
"handlebars": "4.7.7",
"istanbul": "^0.4.5",
"jose": "^4.15.5",
"markdown-it": "^14.0.0",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1",
"node-cache": "^5.1.2",
"nodemailer": "^6.9.9",
"nyc": "^15.1.0",
"oauth": "0.10.0",
"passport": "^0.7.0",
"passport-google-oauth20": "2.0.0",
"passport-local": "^1.0.0",
"passport-oauth2": "1.7.0",
"pouchdb": "7.3.1",
"pouchdb-find": "8.0.1",
"pouchdb-security-helper": "^2.1.2",
"qrcode": "^1.5.3",
"req-flash": "^0.0.3",
"swagger-ui-dist": "^5.9.1",
"uuid": "9.0.1"
},
"devDependencies": {
"@faims3/config-release-it": "*",
"@types/archiver": "^6.0.2",
"@types/chai": "^4.3.9",
"@types/cookie-session": "2.0.47",
"@types/cors": "2.8.17",
"@types/express": "4.17.18",
"@types/express-handlebars": "5.3.1",
"@types/express-session": "1.17.9",
"@types/markdown-it": "^13.0.7",
"@types/mocha": "^10.0.3",
"@types/morgan": "^1.9.5",
"@types/multer": "^1.4.7",
"@types/node": "20.11.19",
"@types/nodemailer": "^6.4.13",
"@types/passport": "^1.0.16",
"@types/passport-google-oauth20": "2.0.13",
"@types/passport-local": "^1.0.35",
"@types/passport-oauth2": "1.4.15",
"@types/pouchdb": "6.4.0",
"@types/qrcode": "^1.5.2",
"@types/sinon": "^10.0.20",
"@types/supertest": "2.0.16",
"@types/swagger-ui-dist": "^3.30.3",
"@types/uuid": "9.0.7",
"chai": "^4.3.10",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"env-cmd": "^10.1.0",
"jest-fast-check": "1.0.2",
"mocha": "^10.2.0",
"nano": "^10.1.2",
"node-fetch": "^3.3.2",
"nodemon": "^2.0.20",
"pouchdb-adapter-memory": "^8.0.1",
"sinon": "^17.0.1",
"supertest": "^6.3.3",
"ts-node": "10.9.1",
"typescript": "^5.5.4"
}
}
1 change: 1 addition & 0 deletions app/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@faims3/config-release-it');
16 changes: 0 additions & 16 deletions app/package-lock.json

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

Loading
Loading