-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (118 loc) · 4.22 KB
/
dotnet.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: .NET
on: [push, pull_request]
jobs:
# generate-matrix:
# # needs: execute-linter
# name: Generate Job Matrix
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# outputs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}
# steps:
# - name: Generate Job Matrix
# id: set-matrix
# env:
# MATRIX: '{"config": [
# {"name": "Linux x86_64 GCC 14","compiler": "GCC","version": "14","os": "ubuntu-20.04","docker_suffix": "-ubuntu20.04", "os_kind": "linux"},
# {"name": "macOS - arm64 - apple-clang 15","compiler": "apple-clang","version": "15","os": "macos-14", "os_kind": "macos"}
# ]}'
# run: |
# echo "${MATRIX}"
# echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
generate-matrix:
name: Generate Job Matrix
# if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Generate Job Matrix
id: set-matrix
env:
MATRIX: '{"config": [
{"name": "macOS 14 (ARM) - NodeJS 20","nodejs_version": "20","os": "macos-14","os_kind": "macos","test": "0"}
]}'
run: |
echo "${MATRIX}"
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
builds:
needs: generate-matrix
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
name: ${{ matrix.config.name }}
steps:
- uses: actions/checkout@v4
- name: Fetch history
# run: git fetch --prune --unshallow
run: git fetch --unshallow
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
# dotnet-version: 3.1.x
# dotnet-version: 5.0.x
# dotnet-version: 6.0.x
dotnet-version: 8.0.x
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# - "python --version"
# - python -m pip install --upgrade pip
# - "%PYTHON%/Scripts/pip.exe install kthbuild --upgrade"
- name: Install Dependencies (Unix)
run: |
python --version
cmake --version
pip install --upgrade pip
pip install kthbuild --upgrade
conan --version
pip install conan --upgrade
conan --version
shell: bash
- name: Pre-Compile
run: |
conan config install https://github.com/k-nuth/ci-utils/raw/master/conan/config2023.zip
conan config install https://github.com/k-nuth/ci-utils/raw/master/conan/config2023.zip
conan remote add kth https://packages.kth.cash/api
conan profile list
conan profile detect
conan profile list
conan install --requires=c-api/0.48.0 --update -o c-api/*:shared=True -s compiler.cppstd=20
shell: bash
- name: Compile
run: ./build.sh Compile
shell: bash
- name: Test
run: |
pwd
find . -name "*kth-c-api*"
./build.sh Test
shell: bash
- name: Pack
run: ./build.sh Pack
shell: bash
- name: Push
if: ${{ matrix.config.os_kind == 'macos' }}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
GHA_COMMIT_MSG: ${{ github.event.head_commit.message }}
PUBLISH_TO_NUGET: "true"
run: |
# Write-Host "NUGET_API_KEY: $Env:NUGET_API_KEY"
# Write-Host "GHA_COMMIT_MSG: $Env:GHA_COMMIT_MSG"
echo "NUGET_API_KEY: ${NUGET_API_KEY}"
echo "GHA_COMMIT_MSG: ${GHA_COMMIT_MSG}"
# $Env:GHA_BRANCH = "${{ github.ref }}".Split("/")[2]
# Write-Host "My branch name is $Env:GHA_BRANCH"
# ./build.sh Push --NugetApiUrl "https://api.nuget.org/v3/index.json" --NugetApiKey $env:NUGET_API_KEY
export GHA_BRANCH=$(echo '${{ github.ref }}' | awk -F '/' '{print $3}')
echo "My branch name is $GHA_BRANCH"
./build.sh Push --NugetApiUrl "https://api.nuget.org/v3/index.json" --NugetApiKey $NUGET_API_KEY
shell: bash
# - name: Restore dependencies
# run: dotnet restore
# - name: Build
# run: dotnet build --no-restore
# - name: Test
# run: dotnet test --no-build --verbosity normal