diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml deleted file mode 100644 index 2923249..0000000 --- a/.github/workflows/cd.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Continuous Deployment - -on: - push: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - verify: - name: Verify - uses: ./.github/workflows/verify.yml - secrets: inherit - - publish: - name: Publish Snapshot - runs-on: ubuntu-latest - needs: verify - - steps: - - uses: actions/checkout@v4 - - - name: Setup Repository - uses: ./.github/actions/setup - - - name: Create Snapshot - id: create_snapshot - run: pnpm changeset version --snapshot canary || echo "No unreleased changesets found" - - - name: Check for Changeset - id: check_changeset - run: echo "changeset_exists=$(grep -q 'No unreleased changesets found' <<< '${{ steps.create_snapshot.outputs.stdout }}' && echo false || echo true)" >> $GITHUB_ENV - - - name: Build - if: env.changeset_exists == 'true' - run: pnpm build - - - name: Publish Snapshot - if: env.changeset_exists == 'true' - run: pnpm changeset publish --snapshot --tag canary --no-git-tag diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d93d4dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,15 @@ +name: Continuous Deployment + +on: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + verify: + name: Verify + uses: ./.github/workflows/verify.yml + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 647ca0f..e0743bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,13 @@ on: push: branches: - main + workflow_dispatch: + inputs: + run-verify: + type: boolean + description: 'Run verification after release' + required: false + default: false concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -32,7 +39,7 @@ jobs: verify: needs: release - if: ${{ needs.release.outputs.pullRequestNumber != '' }} + if: ${{ inputs.run-verify && needs.release.outputs.pullRequestNumber != '' }} uses: ./.github/workflows/verify.yml secrets: inherit with: diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 96d48e3..9468eb1 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,4 +1,4 @@ -name: 'Verify' +name: Verify on: workflow_call: inputs: @@ -44,7 +44,7 @@ jobs: steps: - uses: actions/checkout@v4 - + - name: Setup Repository uses: ./.github/actions/setup @@ -64,6 +64,3 @@ jobs: if: ${{ inputs.run-acceptance }} shell: bash run: pnpm spec - - -