Publish JS packages #1
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: Publish JS packages | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
npm: | |
name: Publish JS packages | |
if: github.ref_type == 'tag' && github.repository == 'Tietokilta/ilmomasiina' | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- | |
name: Check out the repo | |
uses: actions/checkout@v3 | |
- | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
- | |
name: Setup Node.js for NPM | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
node-version: '16' | |
cache: 'pnpm' | |
- | |
name: Install dependencies | |
run: | | |
npm install -g pnpm@7 | |
pnpm install --frozen-lockfile --ignore-scripts | |
- | |
name: Build packages | |
run: | | |
pnpm run --filter @tietokilta/ilmomasiina-models build | |
pnpm run --filter @tietokilta/ilmomasiina-components build | |
- | |
name: Publish to NPM | |
run: | | |
pnpm publish --filter @tietokilta/ilmomasiina-models --no-git-checks --access public | |
pnpm publish --filter @tietokilta/ilmomasiina-components --no-git-checks --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- | |
name: Setup Node.js for GitHub Packages | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://npm.pkg.github.com' | |
- | |
name: Publish to GitHub Packages | |
run: | | |
pnpm publish --filter @tietokilta/ilmomasiina-models --no-git-checks --access public | |
pnpm publish --filter @tietokilta/ilmomasiina-components --no-git-checks --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |