Skip to content

Commit

Permalink
Additional fixes for Release configuration (#133)
Browse files Browse the repository at this point in the history
* Additional fixes for Release configuration
  • Loading branch information
mlhaufe authored Jun 6, 2020
1 parent b3d5801 commit f54e43d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 45 deletions.
106 changes: 63 additions & 43 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,74 @@ on:
types: [created]

jobs:
build-release:
build:
name: 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
steps:
- uses: actions/checkout@v2
- name: Setup 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: Install dependencies
run: npm install
- name: Build
run: npm run build-nofix
- name: Run unit tests
run: npm test
- name: Create package
run: npm pack
- name: Rename package to generic name
run: mv *.tgz final-hill-decorator-contracts.tgz
- name: Upload package
uses: actions/upload-artifact@v1
with:
name: artifact
path: final-hill-decorator-contracts.tgz

- name: configure npmrc
run: npm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
release:
name: Publish to npm
needs: build
runs-on: windows-latest

- run: npm publish final-hill-decorator-contracts.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
strategy:
matrix:
node-version: [14.x]

steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: artifact
- name: Extract package from artifact
run: tar -xf artifact.zip
- name: Cleanup artifact
run: del artifact.zip
- name: Extract package
run: tar -xf final-hill-decorator-contracts.tgz --strip 1
- name: Cleanup package
run: del final-hill-decorator-contracts.tgz
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
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.3

* Additional fixes for Release configuration

## v0.17.2

* Bugfixed Release Configuration
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.2",
"version": "0.17.3",
"description": "Code Contracts for TypeScript and ECMAScript classes",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit f54e43d

Please sign in to comment.