Skip to content

fix(deploy): guard $1 under set -u when no arg is passed #98

fix(deploy): guard $1 under set -u when no arg is passed

fix(deploy): guard $1 under set -u when no arg is passed #98

name: Publish Packages on Version Change
on:
workflow_dispatch:
push:
branches:
- master
env:
# Required for the `old-site` app to build
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GH_PAT: ${{ secrets.GH_PAT }}
PUBLIC_URL: ${{ secrets.PUBLIC_URL }}
# Required for the `website` package to build
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
with:
version: 10
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install Rush
run: pnpm install -g @microsoft/rush
- name: Install native build deps for node-canvas
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- name: Install dependencies
run: rush install
- name: Build packages
run: NODE_ENV=production rush build
# CI only UPDATES existing packages; it never CREATES new ones. The tokens
# below are intentionally scoped to the existing @meese-os packages, so a
# brand-new package name fails with a 404 on publish. Publish a new
# package's first version manually (npm publish --access public from its
# directory) before merging it to master.
- name: Publish to npmjs Package Registry
run: |
rush publish --publish --include-all --registry https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish to GitHub Package Registry
run: |
rush publish --publish --include-all --registry https://npm.pkg.github.com/
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}