Skip to content

Commit

Permalink
Updated CI/CD configuration (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlhaufe authored Jun 5, 2020
1 parent ac8ab25 commit 719a21d
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 113 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Reference: <https://help.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions>
name: Build/Release

on:
release:
types: [created]

jobs:
build:
runs-on: windows-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache Node.js modules
uses: actions/cache@v1
with:
path: "%AppData%\npm-cache" # npm cache files are stored under the AppData folder on Windows
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: npm install, build, and test
run: |
npm install
npm run build-nofix
npm test
env:
CI: true

- name: npm pack
run: npm pack
working-directory: ./

- name: Rename package
run: mv *.tgz final-hill-decorator-contracts.tgz

- name: Upload package
uses: actions/upload-artifact@v1
with:
name: package
path: final-hill-decorator-contracts.tgz
release:
runs-on: windows-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Download package
uses: actions/download-artifact@v1
with:
name: package

- name: configure npmrc
run: npm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"

- run: npm publish ./package/final-hill-decorator-contracts.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 3 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# Reference: <https://help.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions>
name: Build

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
validate:
runs-on: windows-latest

strategy:
matrix:
node-version: [14.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -44,16 +39,3 @@ jobs:
npm test
env:
CI: true

- name: npm pack
run: npm pack
working-directory: ./

- name: Rename package
run: mv *.tgz final-hill-decorator-contracts.tgz

- name: Upload package
uses: actions/upload-artifact@v1
with:
name: package
path: final-hill-decorator-contracts.tgz
44 changes: 0 additions & 44 deletions .github/workflows/release.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/validation.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.17.1

* Updated CI/CD configuration

## v0.17.0

* Migrated repository from Azure Devops to GitHub
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@final-hill/decorator-contracts",
"version": "0.17.0",
"version": "0.17.1",
"description": "Code Contracts for TypeScript and ECMAScript classes",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 719a21d

Please sign in to comment.