Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add react example with use balance hook #280

feat: add react example with use balance hook

feat: add react example with use balance hook #280

name: Publish Canary Releases
on:
workflow_dispatch:
branches:
- master
pull_request:
types: [opened, synchronize, labeled]
permissions:
contents: read
env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1
# Enables Turborepo Remote Caching.
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
build-and-publish-snapshots-to-npm:
permissions:
pull-requests: write
runs-on: ubuntu-latest
# Only run if it's a push to master, manual dispatch, or PR with 'canary' label
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'canary'))
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
- name: Run Build Step (force)
run: pnpm turbo build --force=true
- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Canary Releases
run: |
find packages/* -maxdepth 0 -type d -print0 | \
xargs -t0 -n 1 -I {} \
sh -c 'cd {} && pnpm pkg delete devDependencies'
pnpm changeset version --snapshot canary
pnpm turbo publish-packages --concurrency=${TURBO_CONCURRENCY:-1}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_TAG: canary
- name: Remove canary label from PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'canary'
});