Clean up some of the test, finish implementing auto publish on both npm and git
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
This commit is contained in:
parent
ed73607e7b
commit
0f504eaf53
4 changed files with 33 additions and 3 deletions
20
appveyor.yml
20
appveyor.yml
|
@ -38,12 +38,28 @@ artifacts:
|
||||||
# on successful build
|
# on successful build
|
||||||
on_success:
|
on_success:
|
||||||
- sh: |
|
- sh: |
|
||||||
CURR_VER=$(npm view package.json version)
|
apk add curl jq
|
||||||
if curl -s -X GET -H "token: $deploytoken" https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases | grep -o "\"name\"\:\"v${CURR_VER}\"" > /dev/null; then
|
CURR_VER=$(cat package.json | jq -r .version)
|
||||||
|
if curl -s -X GET -H "Authorization: token $deploytoken" https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases | grep -o "\"name\"\:\"v${CURR_VER}\"" > /dev/null; then
|
||||||
echo "Release already exists, nothing to do.";
|
echo "Release already exists, nothing to do.";
|
||||||
else
|
else
|
||||||
./test/7zas a -mx9 "${CURR_VER}_sc-core.7z" package.json index.mjs cli.mjs core bin
|
./test/7zas a -mx9 "${CURR_VER}_sc-core.7z" package.json index.mjs cli.mjs core bin
|
||||||
|
echo "Creating release on gitea"
|
||||||
|
RELEASE_RESULT=$(curl \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token $deploytoken" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases \
|
||||||
|
-d "{\"tag_name\":\"v${CURR_VER}\",\"name\":\"v${CURR_VER}\",\"body\":\"Automatic release from Appveyor from ${APPVEYOR_REPO_COMMIT}: ${APPVEYOR_REPO_COMMIT_MESSAGE}\"}")
|
||||||
|
RELEASE_ID=$(echo $RELEASE_RESULT | jq -r .id)
|
||||||
|
echo "Adding ${CURR_VER}_sc-core.7z to release ${RELEASE_ID}"
|
||||||
|
curl \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token $deploytoken" \
|
||||||
|
-F "attachment=@${CURR_VER}_sc-core.7z" \
|
||||||
|
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases/$RELEASE_ID/assets
|
||||||
echo '//registry.npmjs.org/:_authToken=${npmtoken}' > ~/.npmrc
|
echo '//registry.npmjs.org/:_authToken=${npmtoken}' > ~/.npmrc
|
||||||
|
echo "Publishing new version to npm"
|
||||||
npm publish
|
npm publish
|
||||||
fi
|
fi
|
||||||
- sh: |
|
- sh: |
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "service-core",
|
"name": "service-core",
|
||||||
"version": "3.0.0-beta.1",
|
"version": "3.0.0-beta.2",
|
||||||
"description": "Core boiler plate code to install node server as windows service",
|
"description": "Core boiler plate code to install node server as windows service",
|
||||||
"main": "index.mjs",
|
"main": "index.mjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -255,6 +255,12 @@ t.describe('#init()', function() {
|
||||||
Core.providers.set(assertProviderName, FakeProvider)
|
Core.providers.set(assertProviderName, FakeProvider)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.after(function() {
|
||||||
|
return Promise.all([
|
||||||
|
fs.rm('./log_test_1.log', { recursive: true, force: true }),
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
t.test('it should call util.verifyConfig correctly', async function() {
|
t.test('it should call util.verifyConfig correctly', async function() {
|
||||||
const assertError = new Error('Red faction IO drive mix')
|
const assertError = new Error('Red faction IO drive mix')
|
||||||
const assertConfig = { a: 1 }
|
const assertConfig = { a: 1 }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Eltro as t, assert, stub } from 'eltro'
|
import { Eltro as t, assert, stub } from 'eltro'
|
||||||
|
import fs from 'fs/promises'
|
||||||
import getLog from '../core/log.mjs'
|
import getLog from '../core/log.mjs'
|
||||||
|
|
||||||
t.describe('#constructor', function() {
|
t.describe('#constructor', function() {
|
||||||
|
@ -6,6 +7,13 @@ t.describe('#constructor', function() {
|
||||||
process.env.NODE_ENV = null
|
process.env.NODE_ENV = null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
t.after(function() {
|
||||||
|
return Promise.all([
|
||||||
|
fs.rm('./log.log', { recursive: true, force: true }),
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
t.test('should add name', function() {
|
t.test('should add name', function() {
|
||||||
const assertName = 'Stray Cat'
|
const assertName = 'Stray Cat'
|
||||||
let logger = getLog(assertName)
|
let logger = getLog(assertName)
|
||||||
|
|
Loading…
Reference in a new issue