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 job to autoupdate cosmocc #71

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/check_cosmocc_releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Periodic check for new cosmocc releases

on:
workflow_dispatch:
schedule:
- cron: "15 4 * * *"

permissions:
contents: write
pages: write
id-token: write

jobs:
check_new_releases:
name: Check for new releases
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check versions
run: |
CURRENT=$(cat .github/workflows/build_python.yml | yq .jobs.build_cosmo.steps[0].with.version)
LATEST=$(curl -s -S -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/jart/cosmopolitan/releases | jq -r .[0].tag_name)
echo "current=${CURRENT}" >> "$GITHUB_ENV"
echo "latest=${LATEST}" >> "$GITHUB_ENV"

- name: Do update
if: ${{ env.current != env.latest }}
run: |
sed -i 's/${{ env.current }}/${{ env.latest }}/g' .github/workflows/build_python.yml

- name: Create PR
uses: peter-evans/create-pull-request@v6
with:
commit-message: '[:robot:] Bump Cosmpolitan to ${{ env.latest }}'
title: '[🤖] Bump Cosmpolitan to ${{ env.latest }}'
body: Automatically generated PR - Bumping Cosmpolitan from ${{ env.current }} to ${{ env.latest }}
branch: bump-cosmocc
delete-branch: true
Loading