Skip to content

Commit 90125cb

Browse files
committed
Initial set of workflows
1 parent d0d7a11 commit 90125cb

7 files changed

Lines changed: 266 additions & 1 deletion

File tree

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: ds5678 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: ds5678 # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: ['https://paypal.me/ds5678'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
13+
- package-ecosystem: "github-actions"
14+
# Workflow files stored in the
15+
# default location of `.github/workflows`
16+
directory: "/"
17+
schedule:
18+
interval: "daily"

.github/workflows/build_full.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Build - Full
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build_native:
12+
runs-on: ${{ matrix.config.runner }}
13+
14+
strategy:
15+
matrix:
16+
config:
17+
- { name: win_x64, runner: windows-latest, os: Windows, arch: x64 }
18+
- { name: win_arm64, runner: windows-latest, os: Windows, arch: arm64 }
19+
- { name: linux_x64, runner: ubuntu-22.04, os: Linux, arch: x64 }
20+
- { name: linux_arm64, runner: ubuntu-22.04, os: Linux, arch: arm64 }
21+
- { name: mac_x64, runner: macos-latest, os: MacOS, arch: x64 }
22+
- { name: mac_arm64, runner: macos-latest, os: MacOS, arch: arm64 }
23+
24+
name: Build - ${{ matrix.config.os }} ${{ matrix.config.arch }}
25+
steps:
26+
- name: Install MSVC ARM64 Tools (Windows ARM64)
27+
if: matrix.config.os == 'Windows' && matrix.config.arch == 'arm64'
28+
uses: ilammy/msvc-dev-cmd@v1
29+
with:
30+
arch: arm64
31+
32+
- name: Install Dependencies (Linux ARM64)
33+
if: matrix.config.os == 'Linux' && matrix.config.arch == 'arm64'
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu cmake
37+
38+
- name: Update Submodules
39+
run: git submodule update --init --recursive
40+
41+
- name: Navigate to Submodule
42+
run: cd NativeCode
43+
44+
- name: Build (x64)
45+
if: matrix.config.arch == 'x64'
46+
run: |
47+
mkdir build
48+
cd build
49+
cmake .. -DCMAKE_BUILD_TYPE=Release
50+
cmake --build . --config Release
51+
52+
- name: Build (Windows ARM64)
53+
if: matrix.config.os == 'Windows' && matrix.config.arch == 'arm64'
54+
run: |
55+
mkdir build
56+
cd build
57+
cmake .. -DCMAKE_BUILD_TYPE=Release -A ARM64
58+
cmake --build . --config Release
59+
60+
- name: Build (Linux ARM64)
61+
if: matrix.config.os == 'Linux' && matrix.config.arch == 'arm64'
62+
run: |
63+
mkdir build
64+
cd build
65+
cmake .. -DCMAKE_SYSTEM_NAME=Linux \
66+
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
67+
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
68+
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
69+
-DCMAKE_BUILD_TYPE=Release
70+
cmake --build . --config Release
71+
72+
- name: Build (macOS ARM64)
73+
if: matrix.config.os == 'MacOS' && matrix.config.arch == 'arm64'
74+
run: |
75+
mkdir build
76+
cd build
77+
cmake .. \
78+
-DCMAKE_BUILD_TYPE=Release \
79+
-DCMAKE_OSX_ARCHITECTURES=arm64
80+
cmake --build . --config Release
81+
82+
- name: List Files
83+
run: ls -R build
84+
85+
- name: Upload (Windows)
86+
if: matrix.config.os == 'Windows'
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: output_${{ matrix.config.name }}
90+
path: |
91+
build/Release/dxil-spirv-c-shared.dll
92+
if-no-files-found: error
93+
94+
- name: Upload (Linux)
95+
if: matrix.config.os == 'Linux'
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: output_${{ matrix.config.name }}
99+
path: |
100+
build/libdxil-spirv-c-shared.so
101+
if-no-files-found: error
102+
103+
- name: Upload (MacOS)
104+
if: matrix.config.os == 'MacOS'
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: output_${{ matrix.config.name }}
108+
path: |
109+
build/libdxil-spirv-c-shared.dylib
110+
if-no-files-found: error
111+
112+
build_managed:
113+
114+
runs-on: ubuntu-latest
115+
needs: build_native
116+
117+
steps:
118+
- uses: actions/checkout@v4
119+
- name: Setup .NET
120+
uses: actions/setup-dotnet@v4
121+
with:
122+
dotnet-version: 9.0.x
123+
- name: Restore dependencies
124+
run: dotnet restore
125+
- name: Build
126+
run: dotnet build --no-restore
127+
- name: Test
128+
run: dotnet test --no-build --verbosity normal

.github/workflows/build_simple.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build - Simple
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 9.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
- name: Build
23+
run: dotnet build --no-restore
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Update Submodules
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # runs every day at midnight UTC
6+
workflow_dispatch: # manual trigger
7+
8+
jobs:
9+
update-submodules:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository (with submodules)
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Configure Git
20+
run: |
21+
git config user.name "github-actions[bot]"
22+
git config user.email "github-actions[bot]@users.noreply.github.com"
23+
24+
- name: Update submodules
25+
run: |
26+
git submodule update --remote
27+
git add -A
28+
29+
- name: Check if there are changes
30+
id: changes
31+
run: |
32+
if git diff --cached --quiet; then
33+
echo "No changes."
34+
echo "changed=false" >> $GITHUB_ENV
35+
else
36+
echo "Submodules updated."
37+
echo "changed=true" >> $GITHUB_ENV
38+
fi
39+
40+
- name: Setup .NET
41+
if: env.changed == 'true'
42+
uses: actions/setup-dotnet@v4
43+
with:
44+
dotnet-version: 9.0.x
45+
46+
- name: Run generator
47+
if: env.changed == 'true'
48+
run: |
49+
bash ./generate.bat
50+
git add -A
51+
52+
- name: Check if it can build
53+
if: env.changed == 'true'
54+
run: dotnet build
55+
56+
- name: Commit and push changes
57+
if: env.changed == 'true'
58+
run: |
59+
BRANCH_NAME="update-submodules-$(date +%Y%m%d%H%M%S)"
60+
git checkout -b $BRANCH_NAME
61+
git commit -m "Update submodules"
62+
git push origin $BRANCH_NAME
63+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
64+
65+
- name: Create Pull Request
66+
if: env.changed == 'true'
67+
uses: peter-evans/create-pull-request@v6
68+
with:
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
branch: ${{ env.branch_name }}
71+
title: "Update Git submodules"
72+
body: |
73+
This PR updates the Git submodules to their latest commits.
74+
- Auto-generated by GitHub Actions
75+

AssetRipper.Bindings.DxilSpirV.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Bindings.DxilSp
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Bindings.DxilSpirV.Original.Generator", "AssetRipper.Bindings.DxilSpirV.Original.Generator\AssetRipper.Bindings.DxilSpirV.Original.Generator.csproj", "{E505A009-8EFE-428E-B5C4-DA45E6EFC8C6}"
2525
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
27+
ProjectSection(SolutionItems) = preProject
28+
.github\workflows\build_full.yml = .github\workflows\build_full.yml
29+
.github\workflows\build_simple.yml = .github\workflows\build_simple.yml
30+
.github\workflows\update_submodules.yml = .github\workflows\update_submodules.yml
31+
EndProjectSection
32+
EndProject
2633
Global
2734
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2835
Debug|Any CPU = Debug|Any CPU

generate.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dotnet tool update --global ClangSharpPInvokeGenerator
33
cd AssetRipper.Bindings.DxilSpirV.Original.Generator
44
dotnet run
55
cd ../AssetRipper.Bindings.DxilSpirV.Generator
6-
dotnet run
6+
dotnet run
7+
cd ..

0 commit comments

Comments
 (0)