Skip to content

Commit

Permalink
fix(*): add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig committed May 22, 2020
1 parent 1fd807d commit 60f08a2
Show file tree
Hide file tree
Showing 9 changed files with 7,362 additions and 682 deletions.
4 changes: 4 additions & 0 deletions .actionspanel/buttons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
buttons:
- title: Release Version
action: "semantic_release"
description: Create a new version through semantic-release
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
repository_dispatch:
types: [semantic_release]
name: Release new version
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SLACK_WEBHOOK }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: npx semantic-release
48 changes: 48 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@google/semantic-release-replace-plugin", {
"replacements": [
{
"files": ["src/environments/environment.ts", "src/environments/environment.prod.ts"],
"from": "appVersion: \".*\"",
"to": "appVersion: \"${nextRelease.version}\"",
"results": [
{
"file": "src/environments/environment.ts",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
},
{
"file": "src/environments/environment.prod.ts",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}],
["@semantic-release/npm", {
"npmPublish": false
}],
["@semantic-release/git", {
"assets": ["src/environments/environment.ts", "src/environments/environment.prod.ts", "package.json"]
}],
["@semantic-release/exec", {
"publishCmd": "./docker/publish.sh ${nextRelease.version} && tar -zcf ndb-core_${nextRelease.version}.tar.gz dist"
}],
["@semantic-release/github", {
"assets": "ndb-core_${nextRelease.version}.tar.gz"
}],
["semantic-release-slack-bot", {
"packageName": "ndb-server",
"notifyOnSuccess": true,
"notifyOnFail": true
}]
]
}
21 changes: 0 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ branches:
- gh-pages
node_js:
- '12'
env:
global:
- DOCKER_USERNAME=aamdigitaltravis
matrix:
- secure: gOMHgEFJXKZxL7NK6IknMabOqAFYDgLa46bJZpluOCv8+TEBENaSV0p6qm1yns8QdaGFi2RzXqo3AQxDj5YI7C57YyvZNkeUtFD8OXY25Ls/o9YXiVYU89Pca6MJor6PskwIpAw8kuq5i9gOfyLQyKmLwaGwD5KlCw2I2UCcyxUWIlrWgDDQLLTRWjKEt7FVbJjuXiILBSI8hPDJ1IwhmGFc1eJRBMQu3HomyvOK48bT6d5nRpcraPApXROP+X1sTekfDZ3GpiVMEl2dvqITviXoAM0RaWfIy6J45k/LKMYlA4554NbZR4lGM+BiGInXG5iklpXCCbex9wgQ2tpoMqEKhelV7ducsjztmykzAOLH88ArDtlv2O+fqfvgnErkuhg/apWb2nv1e38y5j0Jg7VmQnlQ6W7N16+FYSqvlHJbLRSi74NlWj56cgaSKF7ljqcA76seO6E9VjdU72C/d349gJFWUzlKiuKQ3EaXb3ax2+iJ17JSYy2HSSRS7Nkkkbf/gdp9cVDID3CYayPOt/ojNY2Pu/dr8eA6QSNTjHYIcM2SMmJ800FLUvHEfVNUYkhoy7pVdr+4sPlEnqPgxa4llfxxodu3iXLvf5MWVn8qBC6fSmtnRxF1f1vyTBU86y9IOBx58LXZ/pEAddmlCuzHjvni+WpHatOvTxrqo3U=
services:
- docker
apt:
sources:
- google-chrome
Expand Down Expand Up @@ -44,21 +37,7 @@ after_script:
after_success:
- npm run compodoc

before_deploy:
- tar -zcf ndb-core_${TRAVIS_TAG}.tar.gz dist
deploy:
- provider: releases
api_key:
secure: ODYu9vGivpdmPkGUx61EBO402KT/JzsqA8skNnf7YwR0UMbLqzRLbc7rCd/9QHx/SsRDRyt2y0QuiQtnn5qed0ZiFsvM6Zr59cAKN3PPVy3eYT3O5obnmViiM2bWo+cLee0Ch5vPt5CTOyaus5a56gOB5lGW7nx0v+3rakX9RimewGzvED976ZvCUWiV1K0nX9ZFJVWN6CwlRYWosvjM5FHENMu/NYIDHZA+2ZO4gSwaUFsy65Dwj5dTpJIO1xaVkuxE4LwXnHLoaidtPdmMPlS0BbUIPpfn1LE1im/bSd+0cSJDWc6tVQpIMYu814I8Pf1gCDvVB3pz9iibfOyWCB96MR9J9ywjEbmH6E+/XUJmocxgH7busiKIyRAfbs8JYXALd6GAXVFz5MIfhtJ2L4f+oiPT36kumYbA/WDP17q2lPrRy24KyCfs+f7z9/HHRnEsmRJM52cHe2hk2dd3lzXdeehFA+jPF7ilTNPokpG1fUpgWXcKU6UPgIADbO+u33B17CsdmyGbfOIfTCqdYyS9QMrOyXG8QceXNhUUj9GMCRRV5rz9tJhEKtv5Sl11fpxjsOYq4w1n4n6qwrJEPYztIZJOhN4fDsKUkZNrrg2cIVxbDyZCtfhOvMEexyUYMmtTUnDPHQvS5G74H6j7mvSR8GFRoD6Vcph49CBKNs0=
file: "ndb-core_${TRAVIS_TAG}.tar.gz"
skip_cleanup: true
on:
tags: true
- provider: script
script: bash docker/publish.sh $TRAVIS_TAG
skip_cleanup: true
on:
tags: true
- provider: pages
skip_cleanup: true
local_dir: doc/compodoc
Expand Down
10 changes: 7 additions & 3 deletions docker/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ TAG=$1

root=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

rm -r $root/dist
cp -r $root/../dist $root/dist
docker build -t ndb-server $root

cd $root/..
ng build --prod
cd $root
rm -r ./dist
cp -r ../dist ./dist
docker build -t ndb-server .
docker tag ndb-server aamdigital/ndb-server:$TAG
docker push aamdigital/ndb-server:$TAG
Loading

0 comments on commit 60f08a2

Please sign in to comment.