From 24a7756a7ee2598650bdfc37e2f993341693a8f8 Mon Sep 17 00:00:00 2001 From: zirkelc Date: Mon, 7 Oct 2024 09:55:53 +0200 Subject: [PATCH] ci: add release job --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- .github/workflows/release.yml | 30 ------------------------------ 2 files changed, 24 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18a9945..44e651b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,4 +60,27 @@ jobs: if: ${{ steps.install.conclusion == 'success' }} uses: davelosert/vitest-coverage-report-action@v2 with: - vite-config-path: vitest.root.ts \ No newline at end of file + vite-config-path: vitest.root.ts + + release: + name: Release + needs: [lint, test] + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Only run on main push + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup and Install + id: install + uses: ./.github/actions/setup-and-install + with: + node-version: 20 + + - name: Publish + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 87d8daf..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup and Install - id: install - uses: ./.github/actions/setup-and-install - with: - node-version: 20 - - - name: Publish - id: changesets - uses: changesets/action@v1 - with: - publish: pnpm release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file