Skip to content

Commit

Permalink
ci: simplify version bump dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Apr 11, 2024
1 parent 37ab87b commit 450cc4a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ concurrency:
group: "version-bump-${{ github.ref_name }}"

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to run version bump on'
required: true
default: 'alpha'
workflow_dispatch: {}

env:
RELEASE_PLZ_BIN_URL: https://github.com/MarcoIeni/release-plz/releases/download/release-plz-v0.3.43/release-plz-x86_64-unknown-linux-gnu.tar.gz
Expand All @@ -30,8 +25,7 @@ jobs:
with:
fetch-depth: "0"
token: ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
# For workflow_dispatch, use the input branch. Otherwise, use the triggering ref.
ref: ${{ github.event.inputs.branch || github.ref_name }}
ref: ${{ github.ref_name }}

- name: Get the SHA of the last release commit
id: get-sha
Expand All @@ -48,11 +42,11 @@ jobs:
repository-name: ${{ github.repository }}
repository-owner: ${{ github.repository_owner }}
head-sha: ${{ env.sha }}
base-branch: ${{ github.event.inputs.branch || github.ref_name }}
base-branch: ${{ github.ref_name }}
polling-interval: 60

- name: Fetch the latest code from the specified branch
run: git pull origin ${{ github.event.inputs.branch || github.ref_name }}
run: git pull origin ${{ github.ref_name }}

- uses: actions-rs/toolchain@v1
with:
Expand All @@ -79,12 +73,12 @@ jobs:
sudo mv release-plz /usr/local/bin
- shell: bash
# run as the branch name
run: ./resources/scripts/bump_version.sh ${{ github.event.inputs.branch || github.ref_name }}
run: ./resources/scripts/bump_version.sh ${{ github.ref_name }}
- name: push version bump commit
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
branch: ${{ github.event.inputs.branch || github.ref_name }}
branch: ${{ github.ref_name }}
tags: true
- name: post notification to slack on failure
if: ${{ failure() }}
Expand Down

0 comments on commit 450cc4a

Please sign in to comment.