diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 53fe37a238..a97324ffd9 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -3,13 +3,16 @@ name: create-release on: workflow_dispatch: inputs: - environment: - type: choice - description: 'Environment to release to (staging or production)' - options: - - staging - - production + pre_release: + description: "Should this be a pre-release for staging?" required: true + type: boolean + default: true + pre_release_branch: + description: "Branch to use for pre-release" + required: false + type: string + default: "main" jobs: create-release: @@ -29,13 +32,9 @@ jobs: path: .github/ - name: create-release id: release - uses: ./.github/actions/create-release + uses: ./.github/actions/start-semantic-release env: GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} with: - environment: ${{ github.event.inputs.environment }} - write_to_file: "true" - - name: update-package-file - uses: ./.github/actions/semantic-package-json-update - with: - new_version: ${{ steps.release.outputs.tag }} + pre_release: "${{ github.event.inputs.pre_release }}" + pre_release_branch: ${{ github.event.inputs.pre_release_branch }} diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml new file mode 100644 index 0000000000..76d6ecd3b5 --- /dev/null +++ b/.github/workflows/semantic-release.yaml @@ -0,0 +1,30 @@ +name: Semantic Release + +on: + push: + branches: + - staging + - production + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: checkout-repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + token: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} + - name: checkout-actions + uses: actions/checkout@v4 + with: + repository: kiva/github-actions + token: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} + path: .github/ + - name: semantic-release + uses: ./.github/actions/semantic-release + env: + GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} + with: + config: "base"