Skip to content

Commit

Permalink
Add bot to automatically regenerate files via glow
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaaaaaaaa committed Oct 22, 2023
1 parent 07e5d0e commit 702d9c7
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Regenerate bindings
on:
# Uncomment during development to make testing easier
#push:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# Runs on Mon,Thu. For help with cron syntax, see https://crontab.guru/
- cron: '33 1 * * 1,4'

jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- name: Install Mesa
run: |
sudo apt-get update
sudo apt-get install \
libxcursor-dev \
libxrandr-dev \
libxinerama-dev \
libxi-dev \
libgl1-mesa-dev
- name: Checkout gl
uses: actions/checkout@v4
with:
path: gl

- name: Checkout glow
uses: actions/checkout@v4
with:
repository: go-gl/glow
path: glow

- name: Checkout examples
uses: actions/checkout@v4
with:
repository: go-gl/example
path: example

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'

- name: Regenerate files
run: |
go work init
go work use gl/
go work use glow/
go work use example/
cd gl
# Clean up previously generated files
rm -r */
go generate -tags=gen .
go test -v -race ./...
cd ..
# Test for API breakage
go test ./example/...
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
path: gl
commit-message: Regenerate bindings
author: GitHub <[email protected]>
title: Regenerate bindings
body: |
This pull request was triggered by one of the following events:
- https://github.com/go-gl/glow has been updated
- The output of gofmt has changed in the latest Go version
If checks are not available, you may need to close and reopen this pull request.
[See here for details.][2]
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
[2]: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
branch: regenerate

0 comments on commit 702d9c7

Please sign in to comment.