Skip to content

Commit a5c3292

Browse files
committed
Build pushed tags
Signed-off-by: Ilya Leoshkevich <[email protected]>
1 parent 06553ec commit a5c3292

File tree

4 files changed

+83
-18
lines changed

4 files changed

+83
-18
lines changed

.github/workflows/dotnet.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
on:
44
push:
55
branches:
6-
- main
6+
- main
7+
tags:
8+
- 'v.*'
79
pull_request:
810

911
jobs:
@@ -239,6 +241,37 @@ jobs:
239241
with:
240242
name: installer-${{ matrix.arch }}
241243
path: |
242-
local-downloads/
243-
local-packages/
244244
output/
245+
release:
246+
needs: installer
247+
runs-on: ubuntu-latest
248+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
249+
strategy:
250+
matrix:
251+
# TODO: aspnetcore build fails on x64 with:
252+
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
253+
arch: [ppc64le, s390x]
254+
container:
255+
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
256+
credentials:
257+
username: ${{ secrets.GHCR_USERNAME }}
258+
password: ${{ secrets.GHCR_PASSWORD }}
259+
# Workaround for the following:
260+
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
261+
options: --user root
262+
steps:
263+
- name: Configure git
264+
run: git config --global user.email [email protected] &&
265+
git config --global user.name "dotnet-s390x bot"
266+
- name: Checkout
267+
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
268+
- name: Fix the repository ownership
269+
run: chown -R "$(id -u):$(id -g)" .
270+
- name: Download the installer artifacts
271+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
272+
with:
273+
name: installer-${{ matrix.arch }}
274+
- name: Create a release
275+
run: gh release create --notes "" "${{ github.ref_name }}" output/*
276+
env:
277+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dotnet.yml.j2

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ Workflow template. Regenerate the workflow using the ./update script.
77
on:
88
push:
99
branches:
10-
- main
10+
- main
11+
tags:
12+
- 'v.*'
1113
pull_request:
1214

1315
{%- set projects = ['runtime', 'msbuild', 'roslyn', 'sdk', 'aspnetcore', 'installer'] %}
1416

15-
jobs:
16-
{%- for i in range(projects | length) %}
17-
{{ projects[i] }}:
18-
{%- if i != 0 %}
19-
needs: {{ projects[i - 1] }}
20-
{%- endif %}
21-
runs-on: ubuntu-latest
17+
{%- set matrix -%}
2218
strategy:
2319
matrix:
2420
# TODO: aspnetcore build fails on x64 with:
2521
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
2622
arch: [ppc64le, s390x]
23+
{%- endset %}
24+
25+
{%- set container -%}
2726
container:
2827
image: ghcr.io/ibm/dotnet-{% raw %}${{ matrix.arch }}{% endraw %}-toolchain:latest
2928
credentials:
@@ -32,14 +31,29 @@ jobs:
3231
# Workaround for the following:
3332
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
3433
options: --user root
35-
steps:
34+
{%- endset %}
35+
36+
{%- set checkout_steps -%}
3637
- name: Configure git
3738
run: git config --global user.email [email protected] &&
3839
git config --global user.name "dotnet-s390x bot"
3940
- name: Checkout
4041
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
4142
- name: Fix the repository ownership
4243
run: chown -R "$(id -u):$(id -g)" .
44+
{%- endset %}
45+
46+
jobs:
47+
{%- for i in range(projects | length) %}
48+
{{ projects[i] }}:
49+
{%- if i != 0 %}
50+
needs: {{ projects[i - 1] }}
51+
{%- endif %}
52+
runs-on: ubuntu-latest
53+
{{ matrix }}
54+
{{ container }}
55+
steps:
56+
{{ checkout_steps }}
4357
{%- if i != 0 %}
4458
- name: Download the previous stage's artifacts
4559
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
@@ -55,7 +69,25 @@ jobs:
5569
with:
5670
name: {{ projects[i] }}-{% raw %}${{ matrix.arch }}{% endraw %}
5771
path: |
72+
{%- if projects[i] != 'installer' %}
5873
local-downloads/
5974
local-packages/
75+
{%- endif %}
6076
output/
6177
{%- endfor %}
78+
release:
79+
needs: installer
80+
runs-on: ubuntu-latest
81+
if: {% raw %}${{ github.event_name == 'push' && github.ref_type == 'tag' }}{% endraw %}
82+
{{ matrix }}
83+
{{ container }}
84+
steps:
85+
{{ checkout_steps }}
86+
- name: Download the installer artifacts
87+
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
88+
with:
89+
name: installer-{% raw %}${{ matrix.arch }}{% endraw %}
90+
- name: Create a release
91+
run: gh release create --notes "" "{% raw %}${{ github.ref_name }}{% endraw %}" output/*
92+
env:
93+
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}

.github/workflows/toolchain.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docker/**'
9-
- '.github/workflows/toolchain.yml'
8+
- 'docker/**'
9+
- '.github/workflows/toolchain.yml'
1010
pull_request:
1111
paths:
12-
- 'docker/**'
13-
- '.github/workflows/toolchain.yml'
12+
- 'docker/**'
13+
- '.github/workflows/toolchain.yml'
1414

1515
jobs:
1616
toolchain:

.github/workflows/toolchain.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Workflow template. Regenerate the workflow using the ./update script.
66

77
{%- set paths %}
88
paths:
9-
- 'docker/**'
10-
- '.github/workflows/toolchain.yml'
9+
- 'docker/**'
10+
- '.github/workflows/toolchain.yml'
1111
{%- endset %}
1212

1313
on:

0 commit comments

Comments
 (0)