diff --git a/.github/workflows/regenerate.yml b/.github/workflows/regenerate.yml new file mode 100644 index 0000000..08e281f --- /dev/null +++ b/.github/workflows/regenerate.yml @@ -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 + 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