From d5554bf3ecc0d8e1bc9c9c729387485ef9b70aea Mon Sep 17 00:00:00 2001 From: Joshua Kiwiet-Pantaleoni Date: Wed, 1 Nov 2023 13:12:52 -0700 Subject: [PATCH 1/2] feat: semantic-release actions --- .github/workflows/create-release.yaml | 25 ++++++++++----------- .github/workflows/semantic-release.yaml | 30 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/semantic-release.yaml 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" From ec1267b1993a3c14cc4651769e584c80f7273fcd Mon Sep 17 00:00:00 2001 From: Joshua Kiwiet-Pantaleoni Date: Wed, 1 Nov 2023 14:51:34 -0700 Subject: [PATCH 2/2] feat: use node.js config for semantic-release --- .github/workflows/semantic-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml index 76d6ecd3b5..9cd02ce0a9 100644 --- a/.github/workflows/semantic-release.yaml +++ b/.github/workflows/semantic-release.yaml @@ -27,4 +27,4 @@ jobs: env: GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} with: - config: "base" + config: "node"