Skip to content

ci: switch to advanced codeql config #61

ci: switch to advanced codeql config

ci: switch to advanced codeql config #61

name: Continuous Delivery
on:
workflow_dispatch:
inputs:
prNumber:
description: The number of the PR that is being deployed
required: false
type: string
ref:
description: The branch that is being deployed
required: false
default: main
type: string
push:
branches:
- main
env:
TURBO_TELEMETRY_DISABLED: 1
jobs:
publish:
name: Publish Next to NPM
runs-on: ubuntu-latest
if: github.repository_owner == 'Kings-World'
strategy:
fail-fast: false
matrix:
package:
- cron
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: yarn install --immutable
- name: Build Packages
run: yarn build
- name: Bump Versions and Publish
working-directory: packages/${{ matrix.package }}
run: |
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events.
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}')
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)" --skip-changelog
yarn npm publish --tag ${TAG}
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}