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
name: π¦ Release @last9/cdk-express-js | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v3 | |
- name: β¬’ Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.20.0 | |
registry-url: "https://npm.pkg.github.com" | |
#- name: π Get npm cache directory path | |
# id: yarn-cache-dir-path | |
# run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: π§Ά Get NPM cache | |
uses: actions/cache@v3 | |
id: cache-npm # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ | |
hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: π¦ Install dependencies | |
working-directory: ./js/express | |
run: npm install --frozen-lockfile | |
- name: π· Build | |
working-directory: ./js/express | |
run: npm run build | |
- name: π Publish release | |
working-directory: ./js/express | |
if: | |
startsWith(github.ref, 'refs/tags/') && | |
contains(github.event.release.tag_name, '@last9/cdk-express-js') | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm publish --non-interactive |