-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (80 loc) · 2.62 KB
/
update-bindings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Create PR to update bindings
on:
workflow_dispatch:
schedule:
- cron: '0 0 2 5 *'
env:
PR_BRANCH: update-bindings
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 dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-generator-${{ hashFiles('Cargo.lock') }}
- name: Update vita-headers
run: |
echo "VITA_HEADERS_HASH=$(git submodule status | grep generator/vita-headers | cut -d ' ' -f 2)" >> $GITHUB_ENV
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
- name: Commit and create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
title: Update vita-headers bindings
body: Created by the action at [/.workflows/update-bindings.yml](../tree/main/.workflows/update-bindings.yml)
branch: ${{ env.PR_BRANCH }}
delete-branch: true
commit-message: Update vita-headers to ${{ env.VITA_HEADERS_HASH }}
assignees: pheki
committer: Aphek <bilkow@tutanota.com>
author: Aphek <bilkow@tutanota.com>
- name: Trigger build
env:
# Required by Github CLI (`gh`)
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run build.yml --ref ${{ env.PR_BRANCH }}