Files
tools/.github/workflows/publish-dev.yml
2024-05-04 16:04:10 +02:00

31 lines
1.1 KiB
YAML

name: npm | publish dev version
on:
workflow_dispatch:
push:
#paths:
# - packages/poster/**/*
branches:
- 'main'
jobs:
test-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
with:
node-version: 20
- run: corepack enable
- run: yarn
- run: yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
# for every package in the monorepo, publish it to npm
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "dev" for push events, "pr-{prNumber}" for dispatch events.
TAG=$([[ ${{ github.event_name }} == 'push' ]])
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
yarn workspaces foreach --all -pt bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)"
yarn workspaces foreach --all -pt yarn publish --tag ${TAG}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}