Skip to content

fix: remove old ci.yml and old changeset, use only build-and-publish … #3

fix: remove old ci.yml and old changeset, use only build-and-publish …

fix: remove old ci.yml and old changeset, use only build-and-publish … #3

name: Build and Publish

Check failure on line 1 in .github/workflows/build-and-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-and-publish.yml

Invalid workflow file

(Line: 38, Col: 7): Unexpected value 'workflows'
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
bun-version: [latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: ${{ matrix.bun-version }}
- name: Install dependencies
run: bun install
- name: Generate and test all variants
run: bun run test:variants
release:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
pull-requests: write
workflows: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: bun install
- name: Build package
run: bun run build
- name: Check for Changesets
run: |
if [ -d ".changeset" ] && [ "$(ls -A .changeset)" ]; then
echo "has-changesets=true" >> $GITHUB_OUTPUT
else
echo "has-changesets=false" >> $GITHUB_OUTPUT
fi
id: check
- name: Version Packages
if: steps.check.outputs.has-changesets == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
bunx changeset version
git add .
git commit -m "chore: version packages"
git push origin main --force
- name: Publish to npm
if: steps.check.outputs.has-changesets == 'true'
run: bunx changeset publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}