Skip to content

Commit

Permalink
ci: pass release channel into bump_version script
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Feb 14, 2024
1 parent 793f480 commit ad7f867
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ jobs:
rm release-plz-x86_64-unknown-linux-gnu.tar.gz
sudo mv release-plz /usr/local/bin
- shell: bash
run: ./resources/scripts/bump_version.sh ${{ github.event.inputs.channel || 'main' }}
# if we're running a workflow for a release channel, pass that in here, otherwise the script assumes we're on main
run: ./resources/scripts/bump_version.sh ${{ github.event.inputs.channel }}
- name: push version bump commit
uses: ad-m/github-push-action@master
with:
Expand Down
8 changes: 7 additions & 1 deletion resources/scripts/bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

set -e

# optional release channel to pass in
channel_prefix=""
if [ ! -z "$1" ]; then
channel_prefix="$1-"
fi

release-plz update 2>&1 | tee bump_version_output

crates_bumped=()
while IFS= read -r line; do
name=$(echo "$line" | awk -F"\`" '{print $2}')
version=$(echo "$line" | awk -F"-> " '{print $2}')
crates_bumped+=("${name}-v${version}")
crates_bumped+=("${channel_prefix}${name}-v${version}")
done < <(cat bump_version_output | grep "^\*")

len=${#crates_bumped[@]}
Expand Down

0 comments on commit ad7f867

Please sign in to comment.