Skip to content

Commit 3701296

Browse files
committed
Build dotnet with GitHub Actions
Signed-off-by: Ilya Leoshkevich <[email protected]>
1 parent 1a323ba commit 3701296

File tree

2 files changed

+308
-0
lines changed

2 files changed

+308
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# Do not edit this file. It is generated from dotnet.yml.j2.
2+
3+
name: Build dotnet
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
runtime:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
# TODO: aspnetcore build fails on x64 with:
16+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
17+
arch: [ppc64le, s390x]
18+
container:
19+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
20+
credentials:
21+
username: ${{ secrets.GHCR_USERNAME }}
22+
password: ${{ secrets.GHCR_PASSWORD }}
23+
# Workaround for the following:
24+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
25+
options: --user root
26+
steps:
27+
- name: Configure git
28+
run: git config --global user.email [email protected] &&
29+
git config --global user.name "dotnet-s390x bot"
30+
- name: Checkout
31+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
32+
- name: Fix the repository ownership
33+
run: chown -R "$(id -u):$(id -g)" .
34+
- name: Prepare
35+
run: ./dotnet-prepare runtime
36+
- name: Build
37+
run: ARCH=${{ matrix.arch }} ./dotnet-build runtime
38+
- name: Upload the intermediate results
39+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
40+
with:
41+
name: runtime-${{ matrix.arch }}
42+
path: |
43+
local-downloads/
44+
local-packages/
45+
output/
46+
msbuild:
47+
needs: runtime
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
# TODO: aspnetcore build fails on x64 with:
52+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
53+
arch: [ppc64le, s390x]
54+
container:
55+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
56+
credentials:
57+
username: ${{ secrets.GHCR_USERNAME }}
58+
password: ${{ secrets.GHCR_PASSWORD }}
59+
# Workaround for the following:
60+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
61+
options: --user root
62+
steps:
63+
- name: Configure git
64+
run: git config --global user.email [email protected] &&
65+
git config --global user.name "dotnet-s390x bot"
66+
- name: Checkout
67+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
68+
- name: Fix the repository ownership
69+
run: chown -R "$(id -u):$(id -g)" .
70+
- name: Download the previous stage's artifacts
71+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
72+
with:
73+
name: runtime-${{ matrix.arch }}
74+
- name: Prepare
75+
run: ./dotnet-prepare msbuild
76+
- name: Build
77+
run: ARCH=${{ matrix.arch }} ./dotnet-build msbuild
78+
- name: Upload the intermediate results
79+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
80+
with:
81+
name: msbuild-${{ matrix.arch }}
82+
path: |
83+
local-downloads/
84+
local-packages/
85+
output/
86+
roslyn:
87+
needs: msbuild
88+
runs-on: ubuntu-latest
89+
strategy:
90+
matrix:
91+
# TODO: aspnetcore build fails on x64 with:
92+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
93+
arch: [ppc64le, s390x]
94+
container:
95+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
96+
credentials:
97+
username: ${{ secrets.GHCR_USERNAME }}
98+
password: ${{ secrets.GHCR_PASSWORD }}
99+
# Workaround for the following:
100+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
101+
options: --user root
102+
steps:
103+
- name: Configure git
104+
run: git config --global user.email [email protected] &&
105+
git config --global user.name "dotnet-s390x bot"
106+
- name: Checkout
107+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
108+
- name: Fix the repository ownership
109+
run: chown -R "$(id -u):$(id -g)" .
110+
- name: Download the previous stage's artifacts
111+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
112+
with:
113+
name: msbuild-${{ matrix.arch }}
114+
- name: Prepare
115+
run: ./dotnet-prepare roslyn
116+
- name: Build
117+
run: ARCH=${{ matrix.arch }} ./dotnet-build roslyn
118+
- name: Upload the intermediate results
119+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
120+
with:
121+
name: roslyn-${{ matrix.arch }}
122+
path: |
123+
local-downloads/
124+
local-packages/
125+
output/
126+
sdk:
127+
needs: roslyn
128+
runs-on: ubuntu-latest
129+
strategy:
130+
matrix:
131+
# TODO: aspnetcore build fails on x64 with:
132+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
133+
arch: [ppc64le, s390x]
134+
container:
135+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
136+
credentials:
137+
username: ${{ secrets.GHCR_USERNAME }}
138+
password: ${{ secrets.GHCR_PASSWORD }}
139+
# Workaround for the following:
140+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
141+
options: --user root
142+
steps:
143+
- name: Configure git
144+
run: git config --global user.email [email protected] &&
145+
git config --global user.name "dotnet-s390x bot"
146+
- name: Checkout
147+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
148+
- name: Fix the repository ownership
149+
run: chown -R "$(id -u):$(id -g)" .
150+
- name: Download the previous stage's artifacts
151+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
152+
with:
153+
name: roslyn-${{ matrix.arch }}
154+
- name: Prepare
155+
run: ./dotnet-prepare sdk
156+
- name: Build
157+
run: ARCH=${{ matrix.arch }} ./dotnet-build sdk
158+
- name: Upload the intermediate results
159+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
160+
with:
161+
name: sdk-${{ matrix.arch }}
162+
path: |
163+
local-downloads/
164+
local-packages/
165+
output/
166+
aspnetcore:
167+
needs: sdk
168+
runs-on: ubuntu-latest
169+
strategy:
170+
matrix:
171+
# TODO: aspnetcore build fails on x64 with:
172+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
173+
arch: [ppc64le, s390x]
174+
container:
175+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
176+
credentials:
177+
username: ${{ secrets.GHCR_USERNAME }}
178+
password: ${{ secrets.GHCR_PASSWORD }}
179+
# Workaround for the following:
180+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
181+
options: --user root
182+
steps:
183+
- name: Configure git
184+
run: git config --global user.email [email protected] &&
185+
git config --global user.name "dotnet-s390x bot"
186+
- name: Checkout
187+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
188+
- name: Fix the repository ownership
189+
run: chown -R "$(id -u):$(id -g)" .
190+
- name: Download the previous stage's artifacts
191+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
192+
with:
193+
name: sdk-${{ matrix.arch }}
194+
- name: Prepare
195+
run: ./dotnet-prepare aspnetcore
196+
- name: Build
197+
run: ARCH=${{ matrix.arch }} ./dotnet-build aspnetcore
198+
- name: Upload the intermediate results
199+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
200+
with:
201+
name: aspnetcore-${{ matrix.arch }}
202+
path: |
203+
local-downloads/
204+
local-packages/
205+
output/
206+
installer:
207+
needs: aspnetcore
208+
runs-on: ubuntu-latest
209+
strategy:
210+
matrix:
211+
# TODO: aspnetcore build fails on x64 with:
212+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
213+
arch: [ppc64le, s390x]
214+
container:
215+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
216+
credentials:
217+
username: ${{ secrets.GHCR_USERNAME }}
218+
password: ${{ secrets.GHCR_PASSWORD }}
219+
# Workaround for the following:
220+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
221+
options: --user root
222+
steps:
223+
- name: Configure git
224+
run: git config --global user.email [email protected] &&
225+
git config --global user.name "dotnet-s390x bot"
226+
- name: Checkout
227+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
228+
- name: Fix the repository ownership
229+
run: chown -R "$(id -u):$(id -g)" .
230+
- name: Download the previous stage's artifacts
231+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
232+
with:
233+
name: aspnetcore-${{ matrix.arch }}
234+
- name: Prepare
235+
run: ./dotnet-prepare installer
236+
- name: Build
237+
run: ARCH=${{ matrix.arch }} ./dotnet-build installer
238+
- name: Upload the intermediate results
239+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
240+
with:
241+
name: installer-${{ matrix.arch }}
242+
path: |
243+
local-downloads/
244+
local-packages/
245+
output/

.github/workflows/dotnet.yml.j2

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{#-
2+
Workflow template. Use the following command after updating this file:
3+
jinja2 -o .github/workflows/dotnet.yml .github/workflows/dotnet.yml.j2
4+
-#}
5+
6+
# Do not edit this file. It is generated from dotnet.yml.j2.
7+
8+
name: Build dotnet
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
15+
{%- set projects = ['runtime', 'msbuild', 'roslyn', 'sdk', 'aspnetcore', 'installer'] %}
16+
17+
jobs:
18+
{%- for i in range(projects | length) %}
19+
{{ projects[i] }}:
20+
{%- if i != 0 %}
21+
needs: {{ projects[i - 1] }}
22+
{%- endif %}
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
# TODO: aspnetcore build fails on x64 with:
27+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
28+
arch: [ppc64le, s390x]
29+
container:
30+
image: ghcr.io/ibm/dotnet-{% raw %}${{ matrix.arch }}{% endraw %}-toolchain:latest
31+
credentials:
32+
username: {% raw %}${{ secrets.GHCR_USERNAME }}{% endraw %}
33+
password: {% raw %}${{ secrets.GHCR_PASSWORD }}{% endraw %}
34+
# Workaround for the following:
35+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
36+
options: --user root
37+
steps:
38+
- name: Configure git
39+
run: git config --global user.email [email protected] &&
40+
git config --global user.name "dotnet-s390x bot"
41+
- name: Checkout
42+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
43+
- name: Fix the repository ownership
44+
run: chown -R "$(id -u):$(id -g)" .
45+
{%- if i != 0 %}
46+
- name: Download the previous stage's artifacts
47+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
48+
with:
49+
name: {{ projects[i - 1] }}-{% raw %}${{ matrix.arch }}{% endraw %}
50+
{%- endif %}
51+
- name: Prepare
52+
run: ./dotnet-prepare {{ projects[i] }}
53+
- name: Build
54+
run: ARCH={% raw %}${{ matrix.arch }}{% endraw %} ./dotnet-build {{ projects[i] }}
55+
- name: Upload the intermediate results
56+
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
57+
with:
58+
name: {{ projects[i] }}-{% raw %}${{ matrix.arch }}{% endraw %}
59+
path: |
60+
local-downloads/
61+
local-packages/
62+
output/
63+
{%- endfor %}

0 commit comments

Comments
 (0)