Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow to regularly check for a new vroom release #80

Merged
merged 5 commits into from Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/check_release.yml
@@ -0,0 +1,53 @@
name: Check for new VROOM release

on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
check_tz:
name: Check if VROOM has a new release we don't have yet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run script
shell: bash
run: |
set -e

git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

latest_vroom_tag="v1.15.0" #$(curl --silent -L -H "Accept: application/vnd.github+json" https://api.github.com/repos/VROOM-Project/vroom/tags | jq -r '.[0].name')
latest_this_tag=$(git describe --tags --abbrev=0)

# first check vroom
if [[ $latest_vroom_tag == $latest_this_tag ]]; then
"All up-to-date."
exit 0
fi

echo "New Vroom release available: ${latest_vroom_tag}"
new_branch="gha-vroom-release-${latest_vroom_tag}"
git checkout -b $new_branch

# update the README
sed -i "s/v1.14.0/v1.15.0/g" README.md

# commit and push
git commit -am "release ${latest_vroom_tag}"
git push origin "${new_branch}"

# open new PR
body=$(echo -e "Update CHANGELOG with\n- [vroom](https://github.com/VROOM-Project/vroom/blob/master/CHANGELOG.md)\n- [vroom-express](https://github.com/VROOM-Project/vroom-express/blob/master/CHANGELOG.md)\n\nCreated by workflow run [#${WORKFLOW_RUN_ID}](https://github.com/valhalla/valhalla/actions/runs/${WORKFLOW_RUN_ID}).")
gh pr create --base master --head $new_branch --title "New VROOM release ${latest_vroom_tag}" --body "${body}"

exit 1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
WORKFLOW_JOB_ID: ${{ github.job }}