Skip to content

Commit 8fbc8fa

Browse files
Setup CI/CD (MichalStrehovsky#1)
1 parent 0d3afe2 commit 8fbc8fa

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/main.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Release version to create'
11+
required: true
12+
13+
jobs:
14+
build_and_test:
15+
strategy:
16+
matrix:
17+
include:
18+
- vm: windows-latest
19+
runs-on: ${{ matrix.vm }}
20+
name: Build and test ${{ matrix.vm }}
21+
steps:
22+
- name: Checkout repo
23+
uses: actions/checkout@v3
24+
- name: Setup dotnet
25+
uses: actions/setup-dotnet@v2
26+
with:
27+
dotnet-version: '8.0.x'
28+
include-prerelease: true
29+
- name: Setup zig
30+
if: ${{ github.event.inputs.version == '' }}
31+
uses: goto-bus-stop/setup-zig@v2
32+
- name: Build (CI)
33+
if: ${{ github.event.inputs.version == '' }}
34+
run: |
35+
dotnet build -t:Pack src/PublishAotCross.nuproj
36+
dotnet publish -r linux-x64 -c Release test/Hello.csproj -p:StripSymbols=false
37+
- name: Upload test binary
38+
if: ${{ github.event.inputs.version == '' }}
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: Hello
42+
path: test/bin/Release/net8.0/linux-x64/publish/Hello
43+
- name: Build (CD)
44+
if: ${{ github.event.inputs.version != '' }}
45+
run: dotnet build -t:Pack src/PublishAotCross.nuproj -p:Version=${{ github.event.inputs.version }}
46+
- name: Archive NuGet
47+
if: ${{ github.event.inputs.version != '' }}
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: PublishAotCross.${{ github.event.inputs.version }}.nupkg
51+
path: src/bin/Debug/PublishAotCross.${{ github.event.inputs.version }}.nupkg
52+
- name: Create tag
53+
if: ${{ github.event.inputs.version != '' && github.actor == 'MichalStrehovsky' }}
54+
run: |
55+
git tag v${{ github.event.inputs.version }}
56+
git push origin v${{ github.event.inputs.version }}
57+
58+
validate:
59+
needs: build_and_test
60+
runs-on: ubuntu-latest
61+
name: Try launching
62+
steps:
63+
- name: Download all artifacts
64+
uses: actions/download-artifact@v3
65+
- name: Launch
66+
run: |
67+
chmod +x ./Hello/Hello
68+
./Hello/Hello

src/clang.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ set args=%*
1111
rem Works around zlib not being available with zig. This is not great.
1212
set args=%args:-lz =%
1313

14+
rem Work around a .NET 8 Preview 6 issue
15+
set args=%args:'-Wl,-rpath,$ORIGIN'=-Wl,-rpath,$ORIGIN%
16+
1417
rem Work around parameters unsupported by zig. Just drop them from the command line.
1518
set args=%args:--discard-all=--as-needed%
1619
set args=%args:-Wl,-pie =%

0 commit comments

Comments
 (0)