Skip to content

ci: fixed broken publish script #223

ci: fixed broken publish script

ci: fixed broken publish script #223

Workflow file for this run

name: Test, Publish and Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build workspace
run: bun run build
- name: Run tests
run: bun run test
release:
name: Changesets Release
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: latest
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: bun install
- name: Build publishable packages
run: bunx turbo run build --filter={./packages/*}
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
version: bun run version
# changesets/action splits publish on whitespace (first token = executable); use a script.
publish: bun run ci:publish
commit: "chore: version packages"
title: "chore: version packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}