v0.25.1 #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
name: Build | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
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 | |
- 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 | |
release: | |
name: Publish to npm | |
needs: build | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifact | |
- name: Extract package from artifact | |
run: tar -xf artifact/final-hill-decorator-contracts.tgz --strip 1 | |
- 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 }} |