Skip to content

Bump version

Bump version #11

Workflow file for this run

name: Bump version
on:
schedule:
- cron: "0 0 * * 0" # Every Sunday at midnight UTC
workflow_dispatch:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
id: app-token
with:
app-id: ${{ vars.ORCA_BRO_ID }}
private-key: ${{ secrets.ORCA_BRO_PRIVATE_KEY }}
- uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
- id: check
name: Check if bi-weekly run
run: |
week=$((10#$(date +%V)))
if [ $((week % 2)) -eq 0 ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
- if: steps.check.outputs.should_run == 'true'
uses: astral-sh/setup-uv@v7
- if: steps.check.outputs.should_run == 'true'
id: bump
name: Update version
run: |
current=$(cat csda-version.txt)
new_version=$(uv run csda-version next-csda-version "$(date +%Y-%m-%d)" "$current")
echo "$new_version" > csda-version.txt
echo "new_version=$new_version" >> $GITHUB_OUTPUT
- if: steps.check.outputs.should_run == 'true'
name: Create pull request
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
branch="bump-version/${{ steps.bump.outputs.new_version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$branch"
git add csda-version.txt
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }}"
git push -u origin "$branch"
gh pr create \
--title "chore: bump version to ${{ steps.bump.outputs.new_version }}" \
--body "Automated version bump to ${{ steps.bump.outputs.new_version }}"