From be86a6762109400f04f9377047f9b0e5c41647c2 Mon Sep 17 00:00:00 2001 From: Axel Rindle Date: Fri, 6 Dec 2024 17:55:19 +0100 Subject: [PATCH] ci: merge workflows --- .github/workflows/changesets.yml | 46 -------------------------------- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/changesets.yml diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml deleted file mode 100644 index 715793d..0000000 --- a/.github/workflows/changesets.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Changesets - -on: - push: - branches: - - main - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -permissions: - contents: write - pull-requests: write - -jobs: - changesets: - name: Process Changesets - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-${{ hashFiles('bun.lockb') }} - - - name: Install dependencies - run: bun install --frozen-lockfile - - - name: Login to npm - run: | - printf '%s\n\n%s\n' "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" "`cat .npmrc`" > .npmrc - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - # This expects you to have a script called release which does a build for your packages and calls changeset publish - publish: bun run release - env: - GITHUB_TOKEN: ${{ github.token }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7721e52..f90ef11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,3 +31,41 @@ jobs: - name: Lint run: bunx eslint + + changesets: + name: Process Changesets + runs-on: ubuntu-latest + if: github.event_name == 'push' + concurrency: ${{ github.workflow }}-${{ github.ref }} + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('bun.lockb') }} + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Login to npm + run: | + printf '%s\n\n%s\n' "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" "`cat .npmrc`" > .npmrc + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: bun run release + env: + GITHUB_TOKEN: ${{ github.token }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}