-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc96c55
commit d6899f7
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Version & Publish Packages | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
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: ${{ secrets.TURBO_TEAM }} | ||
|
||
jobs: | ||
build-and-publish-to-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
uses: ./.github/workflows/actions/install-dependencies | ||
|
||
# - name: Configure NPM token | ||
# run: | | ||
# pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | ||
# env: | ||
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create Changesets Pull Request or Trigger an NPM Publish | ||
id: changesets | ||
uses: changesets/action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Choose Build Step | ||
id: build-step-decider | ||
run: | ||
echo "step-name=${{ steps.changesets.outputs.hasChangesets == 'false' && 'publish-packages | ||
--concurrency=${TURBO_CONCURRENCY:-1}' || 'build' }}" >> $GITHUB_OUTPUT | ||
|
||
- name: Run Build Step (force) | ||
run: pnpm turbo ${{ steps.build-step-decider.outputs.step-name }} --force=true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
PUBLISH_TAG: next | ||
|
||
# - name: Push Git Tag | ||
# if: steps.changesets.outputs.hasChangesets == 'false' | ||
# run: | | ||
# VERSION_TAG=v$(cd packages/library/ && pnpm pkg get version | sed -n '2p' | grep -o '"\([^"]\)\+"$' | tr -d \") | ||
# if ! git ls-remote --tags | grep -q "$VERSION_TAG"; then git tag $VERSION_TAG && git push --tags; fi | ||
# env: | ||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |