Skip to content

Commit c3be7d0

Browse files
committed
Run actions outside of container
GitHub Actions no longer support Ubuntu 18.04. Signed-off-by: Ilya Leoshkevich <[email protected]>
1 parent b07859c commit c3be7d0

File tree

2 files changed

+85
-124
lines changed

2 files changed

+85
-124
lines changed

.github/workflows/dotnet.yml

+64-98
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,30 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
# TODO: aspnetcore build fails on x64 with:
20-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
2119
arch: [ppc64le, s390x]
2220
isV6:
2321
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
2422
exclude:
2523
- arch: ppc64le
2624
isV6: true
27-
container:
28-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
29-
credentials:
30-
username: ${{ github.actor }}
31-
password: ${{ secrets.GITHUB_TOKEN }}
32-
# Workaround for the following:
33-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
34-
options: --user root
3525
steps:
3626
- name: Configure git
3727
run: git config --global user.email [email protected] &&
3828
git config --global user.name "dotnet-s390x bot"
39-
- name: Checkout
40-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
41-
- name: Fix the repository ownership
42-
run: chown -R "$(id -u):$(id -g)" .
29+
- name: Checkout dotnet-s390x
30+
uses: actions/checkout@v4
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
4337
- name: Prepare
4438
run: ./dotnet-prepare runtime
4539
- name: Build
46-
run: ARCH=${{ matrix.arch }} ./dotnet-build runtime
40+
run: ARCH=${{ matrix.arch }} ./docker/run-image ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest ./dotnet-build runtime
4741
- name: Upload the intermediate results
48-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
42+
uses: actions/upload-artifact@v4
4943
with:
5044
name: runtime-${{ matrix.arch }}
5145
path: |
@@ -57,40 +51,34 @@ jobs:
5751
runs-on: ubuntu-latest
5852
strategy:
5953
matrix:
60-
# TODO: aspnetcore build fails on x64 with:
61-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
6254
arch: [ppc64le, s390x]
6355
isV6:
6456
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
6557
exclude:
6658
- arch: ppc64le
6759
isV6: true
68-
container:
69-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
70-
credentials:
71-
username: ${{ github.actor }}
72-
password: ${{ secrets.GITHUB_TOKEN }}
73-
# Workaround for the following:
74-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
75-
options: --user root
7660
steps:
7761
- name: Configure git
7862
run: git config --global user.email [email protected] &&
7963
git config --global user.name "dotnet-s390x bot"
80-
- name: Checkout
81-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
82-
- name: Fix the repository ownership
83-
run: chown -R "$(id -u):$(id -g)" .
64+
- name: Checkout dotnet-s390x
65+
uses: actions/checkout@v4
66+
- name: Login to GitHub Container Registry
67+
uses: docker/login-action@v3
68+
with:
69+
registry: ghcr.io
70+
username: ${{ github.actor }}
71+
password: ${{ secrets.GITHUB_TOKEN }}
8472
- name: Download the previous stage's artifacts
85-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
73+
uses: actions/download-artifact@v4
8674
with:
8775
name: runtime-${{ matrix.arch }}
8876
- name: Prepare
8977
run: ./dotnet-prepare msbuild
9078
- name: Build
91-
run: ARCH=${{ matrix.arch }} ./dotnet-build msbuild
79+
run: ARCH=${{ matrix.arch }} ./docker/run-image ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest ./dotnet-build msbuild
9280
- name: Upload the intermediate results
93-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
81+
uses: actions/upload-artifact@v4
9482
with:
9583
name: msbuild-${{ matrix.arch }}
9684
path: |
@@ -102,40 +90,34 @@ jobs:
10290
runs-on: ubuntu-latest
10391
strategy:
10492
matrix:
105-
# TODO: aspnetcore build fails on x64 with:
106-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
10793
arch: [ppc64le, s390x]
10894
isV6:
10995
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
11096
exclude:
11197
- arch: ppc64le
11298
isV6: true
113-
container:
114-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
115-
credentials:
116-
username: ${{ github.actor }}
117-
password: ${{ secrets.GITHUB_TOKEN }}
118-
# Workaround for the following:
119-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
120-
options: --user root
12199
steps:
122100
- name: Configure git
123101
run: git config --global user.email [email protected] &&
124102
git config --global user.name "dotnet-s390x bot"
125-
- name: Checkout
126-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
127-
- name: Fix the repository ownership
128-
run: chown -R "$(id -u):$(id -g)" .
103+
- name: Checkout dotnet-s390x
104+
uses: actions/checkout@v4
105+
- name: Login to GitHub Container Registry
106+
uses: docker/login-action@v3
107+
with:
108+
registry: ghcr.io
109+
username: ${{ github.actor }}
110+
password: ${{ secrets.GITHUB_TOKEN }}
129111
- name: Download the previous stage's artifacts
130-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
112+
uses: actions/download-artifact@v4
131113
with:
132114
name: msbuild-${{ matrix.arch }}
133115
- name: Prepare
134116
run: ./dotnet-prepare roslyn
135117
- name: Build
136-
run: ARCH=${{ matrix.arch }} ./dotnet-build roslyn
118+
run: ARCH=${{ matrix.arch }} ./docker/run-image ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest ./dotnet-build roslyn
137119
- name: Upload the intermediate results
138-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
120+
uses: actions/upload-artifact@v4
139121
with:
140122
name: roslyn-${{ matrix.arch }}
141123
path: |
@@ -147,40 +129,34 @@ jobs:
147129
runs-on: ubuntu-latest
148130
strategy:
149131
matrix:
150-
# TODO: aspnetcore build fails on x64 with:
151-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
152132
arch: [ppc64le, s390x]
153133
isV6:
154134
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
155135
exclude:
156136
- arch: ppc64le
157137
isV6: true
158-
container:
159-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
160-
credentials:
161-
username: ${{ github.actor }}
162-
password: ${{ secrets.GITHUB_TOKEN }}
163-
# Workaround for the following:
164-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
165-
options: --user root
166138
steps:
167139
- name: Configure git
168140
run: git config --global user.email [email protected] &&
169141
git config --global user.name "dotnet-s390x bot"
170-
- name: Checkout
171-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
172-
- name: Fix the repository ownership
173-
run: chown -R "$(id -u):$(id -g)" .
142+
- name: Checkout dotnet-s390x
143+
uses: actions/checkout@v4
144+
- name: Login to GitHub Container Registry
145+
uses: docker/login-action@v3
146+
with:
147+
registry: ghcr.io
148+
username: ${{ github.actor }}
149+
password: ${{ secrets.GITHUB_TOKEN }}
174150
- name: Download the previous stage's artifacts
175-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
151+
uses: actions/download-artifact@v4
176152
with:
177153
name: roslyn-${{ matrix.arch }}
178154
- name: Prepare
179155
run: ./dotnet-prepare aspnetcore
180156
- name: Build
181-
run: ARCH=${{ matrix.arch }} ./dotnet-build aspnetcore
157+
run: ARCH=${{ matrix.arch }} ./docker/run-image ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest ./dotnet-build aspnetcore
182158
- name: Upload the intermediate results
183-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
159+
uses: actions/upload-artifact@v4
184160
with:
185161
name: aspnetcore-${{ matrix.arch }}
186162
path: |
@@ -192,40 +168,34 @@ jobs:
192168
runs-on: ubuntu-latest
193169
strategy:
194170
matrix:
195-
# TODO: aspnetcore build fails on x64 with:
196-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
197171
arch: [ppc64le, s390x]
198172
isV6:
199173
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
200174
exclude:
201175
- arch: ppc64le
202176
isV6: true
203-
container:
204-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
205-
credentials:
206-
username: ${{ github.actor }}
207-
password: ${{ secrets.GITHUB_TOKEN }}
208-
# Workaround for the following:
209-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
210-
options: --user root
211177
steps:
212178
- name: Configure git
213179
run: git config --global user.email [email protected] &&
214180
git config --global user.name "dotnet-s390x bot"
215-
- name: Checkout
216-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
217-
- name: Fix the repository ownership
218-
run: chown -R "$(id -u):$(id -g)" .
181+
- name: Checkout dotnet-s390x
182+
uses: actions/checkout@v4
183+
- name: Login to GitHub Container Registry
184+
uses: docker/login-action@v3
185+
with:
186+
registry: ghcr.io
187+
username: ${{ github.actor }}
188+
password: ${{ secrets.GITHUB_TOKEN }}
219189
- name: Download the previous stage's artifacts
220-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
190+
uses: actions/download-artifact@v4
221191
with:
222192
name: aspnetcore-${{ matrix.arch }}
223193
- name: Prepare
224194
run: ./dotnet-prepare sdk
225195
- name: Build
226-
run: ARCH=${{ matrix.arch }} ./dotnet-build sdk
196+
run: ARCH=${{ matrix.arch }} ./docker/run-image ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest ./dotnet-build sdk
227197
- name: Upload the intermediate results
228-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
198+
uses: actions/upload-artifact@v4
229199
with:
230200
name: sdk-${{ matrix.arch }}
231201
path: |
@@ -239,29 +209,25 @@ jobs:
239209
matrix:
240210
arch: [x64]
241211
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
242-
container:
243-
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
244-
credentials:
245-
username: ${{ github.actor }}
246-
password: ${{ secrets.GITHUB_TOKEN }}
247-
# Workaround for the following:
248-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
249-
options: --user root
250212
steps:
251213
- name: Configure git
252214
run: git config --global user.email [email protected] &&
253215
git config --global user.name "dotnet-s390x bot"
254-
- name: Checkout
255-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
256-
- name: Fix the repository ownership
257-
run: chown -R "$(id -u):$(id -g)" .
216+
- name: Checkout dotnet-s390x
217+
uses: actions/checkout@v4
218+
- name: Login to GitHub Container Registry
219+
uses: docker/login-action@v3
220+
with:
221+
registry: ghcr.io
222+
username: ${{ github.actor }}
223+
password: ${{ secrets.GITHUB_TOKEN }}
258224
- name: Download the ppc64le sdk artifacts
259-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
225+
uses: actions/download-artifact@v4
260226
with:
261227
name: sdk-ppc64le
262228
if: ${{ !startsWith(github.ref, 'refs/tags/v6.') }}
263229
- name: Download the s390x sdk artifacts
264-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
230+
uses: actions/download-artifact@v4
265231
with:
266232
name: sdk-s390x
267233
- name: Create a release

.github/workflows/dotnet.yml.j2

+21-26
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ on:
1515
permissions:
1616
packages: read
1717

18-
{%- set arches = ['ppc64le', 's390x'] -%}
18+
{#-
19+
TODO: aspnetcore build fails on x64 with:
20+
EXEC : error : Failed to load assembly 'System.Private.CoreLib'
21+
-#}
22+
{%- set arches = ['ppc64le', 's390x'] %}
1923

2024
{%- set projects = ['runtime', 'msbuild', 'roslyn', 'aspnetcore', 'sdk'] %}
2125

2226
{%- set matrix -%}
2327
strategy:
2428
matrix:
25-
# TODO: aspnetcore build fails on x64 with:
26-
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
2729
arch: [{{ ', '.join(arches) }}]
2830
isV6:
2931
- {% raw %}${{ startsWith(github.ref, 'refs/tags/v6.') }}{% endraw %}
@@ -32,25 +34,20 @@ permissions:
3234
isV6: true
3335
{%- endset %}
3436

35-
{%- set container -%}
36-
container:
37-
image: ghcr.io/ibm/dotnet-{% raw %}${{ matrix.arch }}{% endraw %}-toolchain:latest
38-
credentials:
39-
username: {% raw %}${{ github.actor }}{% endraw %}
40-
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
41-
# Workaround for the following:
42-
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
43-
options: --user root
44-
{%- endset %}
37+
{%- set image -%}ghcr.io/ibm/dotnet-{% raw %}${{ matrix.arch }}{% endraw %}-toolchain:latest{%- endset %}
4538

46-
{%- set checkout_steps -%}
39+
{%- set init_steps -%}
4740
- name: Configure git
4841
run: git config --global user.email [email protected] &&
4942
git config --global user.name "dotnet-s390x bot"
50-
- name: Checkout
51-
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
52-
- name: Fix the repository ownership
53-
run: chown -R "$(id -u):$(id -g)" .
43+
- name: Checkout dotnet-s390x
44+
uses: actions/checkout@v4
45+
- name: Login to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: {% raw %}${{ github.actor }}{% endraw %}
50+
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
5451
{%- endset %}
5552

5653
jobs:
@@ -61,21 +58,20 @@ jobs:
6158
{%- endif %}
6259
runs-on: ubuntu-latest
6360
{{ matrix }}
64-
{{ container }}
6561
steps:
66-
{{ checkout_steps }}
62+
{{ init_steps }}
6763
{%- if i != 0 %}
6864
- name: Download the previous stage's artifacts
69-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
65+
uses: actions/download-artifact@v4
7066
with:
7167
name: {{ projects[i - 1] }}-{% raw %}${{ matrix.arch }}{% endraw %}
7268
{%- endif %}
7369
- name: Prepare
7470
run: ./dotnet-prepare {{ projects[i] }}
7571
- name: Build
76-
run: ARCH={% raw %}${{ matrix.arch }}{% endraw %} ./dotnet-build {{ projects[i] }}
72+
run: ARCH={% raw %}${{ matrix.arch }}{% endraw %} ./docker/run-image {{ image }} ./dotnet-build {{ projects[i] }}
7773
- name: Upload the intermediate results
78-
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
74+
uses: actions/upload-artifact@v4
7975
with:
8076
name: {{ projects[i] }}-{% raw %}${{ matrix.arch }}{% endraw %}
8177
path: |
@@ -90,12 +86,11 @@ jobs:
9086
matrix:
9187
arch: [x64]
9288
if: {% raw %}${{ github.event_name == 'push' && github.ref_type == 'tag' }}{% endraw %}
93-
{{ container }}
9489
steps:
95-
{{ checkout_steps }}
90+
{{ init_steps }}
9691
{%- for arch in arches %}
9792
- name: Download the {{ arch }} sdk artifacts
98-
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
93+
uses: actions/download-artifact@v4
9994
with:
10095
name: sdk-{{ arch }}
10196
{%- if arch == 'ppc64le' %}

0 commit comments

Comments
 (0)