Skip to content

πŸ“¦ Publish 🐍 snekmate to npm #5

πŸ“¦ Publish 🐍 snekmate to npm

πŸ“¦ Publish 🐍 snekmate to npm #5

Workflow file for this run

name: πŸ“¦ Publish 🐍 snekmate to npm
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ${{ matrix.os }}
environment:
name: npm
url: https://www.npmjs.com/package/snekmate
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 18
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore Yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
registry-url: "https://registry.npmjs.org"
- name: Install Yarn project with a clean slate
run: yarn install --prefer-offline --frozen-lockfile
- name: Publish to npm
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}