Create PR to update bindings #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update bindings | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 */2 *' | |
jobs: | |
install-vitasdk: | |
uses: ./.github/workflows/setup-vitasdk.yml | |
with: | |
path: /opt/vitasdk | |
update-and-regenrate: | |
name: Update and regenerate | |
runs-on: ubuntu-latest | |
needs: install-vitasdk | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Restore vitasdk cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: /opt/vitasdk | |
key: ${{ runner.os }}-vitasdk | |
fail-on-cache-miss: true | |
- name: Cache LLVM and Clang | |
id: cache-llvm | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ runner.temp }}/llvm | |
key: llvm | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14" | |
directory: ${{ runner.temp }}/llvm | |
cached: ${{ steps.cache-llvm.outputs.cache-hit }} | |
- name: Cache generator depenedencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
generator/target/ | |
key: ${{ runner.os }}-cargo-generator-${{ hashFiles('generator/Cargo.lock') }} | |
- name: Update vita-headers | |
run: | | |
git submodule update --recursive --remote generator/vita-headers | |
- name: Regenerate bindings | |
env: | |
VITASDK: /opt/vitasdk | |
# From clang-sys | |
LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib | |
LLVM_CONFIG_PATH: ${{ runner.temp }}/llvm/bin/llvm-config | |
run: | | |
cd generator | |
cargo run | |
cd .. | |
cargo fmt | |
- name: Commit | |
env: | |
# Required by Github CLI (`gh`) | |
GH_TOKEN: ${{ github.token }} | |
# Do not fail when there's nothing to commit | |
continue-on-error: true | |
run: | | |
git add . | |
git config user.name github-actions | |
git config user.email [email protected] | |
VITA_HEADERS_HASH=$(git submodule status | grep generator/vita-headers | cut -d ' ' -f 2) | |
git commit -m "Update vita-headers to $VITA_HEADERS_HASH" | |
git push | |
gh workflow run build-example.yml --ref ${GITHUB_REF} |