This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
chore(deps): update dependency @types/node to v20.11.20 #325
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: Test and Publish | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup caching | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-cache-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-cache- | |
- name: Install dependencies | |
run: | | |
yarn | |
- name: Run tests | |
run: | | |
yarn build | |
yarn test | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup caching | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-cache-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-cache- | |
- name: Install dependencies | |
run: | | |
yarn | |
- name: Build library | |
run: | | |
yarn build | |
- name: Prepare for publishing | |
id: prepare_publish | |
run: | | |
export ref='${{ github.ref }}' | |
export tag=${ref:11} | |
echo "::set-output name=tag::$tag" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '12.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish to NPM | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
TAG: ${{ steps.prepare_publish.outputs.tag }} | |
run: | | |
yarn publish --new-version $TAG | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: '-' |