diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 346c4962..95415940 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,12 @@ name: Release on: - push: - branches: - - main workflow_dispatch: - # inputs: - # release_type: - # description: Type of release to perform - # required: true - # default: patch + inputs: + release_type: + description: Type of release to perform + required: true + default: patch jobs: build-and-publish: @@ -18,33 +15,33 @@ jobs: environment: 'prod' steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - # - name: Configure git user - # run: | - # git config user.name "$GITHUB_ACTOR" - # git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - # # Checkout branch, bump version, push, merge, create release - # - name: Setup Node - # id: setup_node - # uses: prefecthq/actions-setup-nodejs@main + - name: Configure git user + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + # Checkout branch, bump version, push, merge, create release + - name: Setup Node + id: setup_node + uses: prefecthq/actions-setup-nodejs@main - # - name: Bump Package Version - # id: bump_version - # run: | - # npm version ${{ inputs.release_type }} - # echo "RELEASE_VERSION=$(cat package.json | jq .version | tr -d '"')" >> $GITHUB_ENV + - name: Bump Package Version + id: bump_version + run: | + npm version ${{ inputs.release_type }} + echo "RELEASE_VERSION=$(cat package.json | jq .version | tr -d '"')" >> $GITHUB_ENV - # - name: Bump Version and Create Release - # run: | - # git checkout -b $RELEASE_VERSION - # git push --set-upstream origin $RELEASE_VERSION - # gh pr create --base main -f - # gh pr merge --squash - # env: - # GITHUB_TOKEN: ${{ secrets.PREFECT_CONTENTS_PR_RW }} + - name: Bump Version and Create Release + run: | + git checkout -b $RELEASE_VERSION + git push --set-upstream origin $RELEASE_VERSION + gh pr create --base main -f + gh pr merge --squash --admin --delete-branch + env: + GITHUB_TOKEN: ${{ secrets.PREFECT_CONTENTS_PR_RW }} - uses: actions/checkout@v4 with: