Skip to content

Instantly share code, notes, and snippets.

@max10rogerio
Created January 31, 2020 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max10rogerio/fa4b16fe44840bdeeb3df998b0d4a05a to your computer and use it in GitHub Desktop.
Save max10rogerio/fa4b16fe44840bdeeb3df998b0d4a05a to your computer and use it in GitHub Desktop.
{
"branch": "master",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "refactor",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "style",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "ci",
"release": "patch"
},
{
"type": "build",
"release": "patch"
},
{
"type": "chore",
"scope": "deps",
"release": "patch"
},
{
"type": "chore",
"scope": "deps-dev",
"release": "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": ":sparkles: Novidades",
"hidden": false
},
{
"type": "fix",
"section": ":bug: Correções",
"hidden": false
},
{
"type": "docs",
"section": ":memo: Documentação",
"hidden": false
},
{
"type": "style",
"section": ":barber: Estilização",
"hidden": false
},
{
"type": "refactor",
"section": ":zap: Refatoração",
"hidden": false
},
{
"type": "perf",
"section": ":fast_forward: Desempenho",
"hidden": false
},
{
"type": "test",
"section": ":white_check_mark: Testes",
"hidden": false
},
{
"type": "ci",
"section": ":repeat: CI",
"hidden": false
},
{
"type": "chore",
"section": ":package: Atualizações",
"hidden": false
}
]
}
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "server.zip",
"label": "DeltaWeb - Build: ${nextRelease.gitTag}",
"name": "server-${nextRelease.gitTag}.zip"
}
]
}
]
]
}
version: 2
defaults: &defaults
working_directory: ~/workspace
docker:
- image: circleci/node:10.15.0
jobs:
prepare_build_release:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- run:
name: Prepare Workspace
command: |
sudo apt-get update
sudo apt-get install zip ca-certificates rsync -y
- run:
name: Install dependencies
command: |
yarn
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package.json" }}
- run:
name: Build typescript
command: yarn build
- run:
name: Remove devDependencies for zip build
command: yarn install --production --ignore-scripts --prefer-offline
- run:
name: Zip Build
command: |
mv node_modules ./build
cp ./.env ./build/.env
cd ./build
zip -q -r server.zip ./
mv ./server.zip ..
cd ..
- run:
name: Install deps for semantic-release
command: yarn
- run:
name: Generate release notes
command: yarn semantic-release
workflows:
version: 2
build:
jobs:
- prepare_build_release:
filters:
branches:
only: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment