Skip to content

Commit b736029

Browse files
workflows: add multiple build targets
1 parent 5744eba commit b736029

File tree

4 files changed

+82
-38
lines changed

4 files changed

+82
-38
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ on:
66
name:
77
required: true
88
type: string
9+
cpu_arch:
10+
required: true
11+
type: string
12+
cpu_tune:
13+
required: true
14+
type: string
915

1016
jobs:
1117
proton:
12-
name: ${{ inputs.name }}
18+
name: Build ${{ inputs.name }}
1319
runs-on: ubuntu-latest
1420
steps:
1521
- name: Prepare host
@@ -19,9 +25,9 @@ jobs:
1925
uses: actions/cache@v4
2026
with:
2127
path: ~/.ccache
22-
key: ccache-proton-${{ github.run_id }}
28+
key: ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}-${{ github.run_id }}
2329
restore-keys: |
24-
ccache-proton
30+
ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}
2531
2632
- name: Checkout
2733
uses: actions/checkout@v4
@@ -32,15 +38,19 @@ jobs:
3238

3339
- name: Patch
3440
run: |
41+
sed 's/-march=nocona/-march=${{ inputs.cpu_arch }}/g' -i Makefile.in
42+
sed 's/-mtune=core-avx2/-mtune=${{ inputs.cpu_tune }}/g' -i Makefile.in
3543
mkdir ./build
3644
3745
- name: Configure
3846
working-directory: ./build
39-
run: ../configure.sh --build-name=${{ inputs.name }} --enable-ccache --container-engine=docker
47+
run: |
48+
../configure.sh --build-name=${{ inputs.name }} --enable-ccache --container-engine=docker
4049
4150
- name: Make ${{ inputs.name }}
4251
working-directory: ./build
43-
run: make -j3 redist
52+
run: |
53+
make -j$(nproc) redist
4454
4555
- name: Upload artifact ${{ inputs.name }}.tar.xz
4656
uses: actions/upload-artifact@v4
@@ -53,3 +63,4 @@ jobs:
5363
with:
5464
name: ${{ inputs.name }}.sha512sum
5565
path: ./build/${{ inputs.name }}.sha512sum
66+

.github/workflows/release.yml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,30 @@ on:
66

77
jobs:
88
build:
9+
strategy:
10+
matrix:
11+
include:
12+
- name: proton-${{ github.ref_name }}-x86_64
13+
cpu_arch: nocona
14+
cpu_tune: core-avx2
15+
- name: proton-${{ github.ref_name }}-x86_64_v3
16+
cpu_arch: core-avx2
17+
cpu_tune: core-avx2
918
name: Build
1019
uses: ./.github/workflows/build.yml
1120
with:
12-
name: proton-${{ github.ref_name }}
21+
name: ${{ matrix.name }}
22+
cpu_arch: ${{ matrix.cpu_arch }}
23+
cpu_tune: ${{ matrix.cpu_tune }}
1324

14-
release:
15-
name: Release ${{ github.ref_name }}
25+
upload:
26+
strategy:
27+
matrix:
28+
include:
29+
- name: proton-${{ github.ref_name }}-x86_64
30+
- name: proton-${{ github.ref_name }}-x86_64_v3
31+
name: Upload
1632
needs: build
17-
runs-on: ubuntu-latest
18-
steps:
19-
- name: Download ${{ github.ref_name }}.tar.xz artifact
20-
uses: actions/download-artifact@v4
21-
with:
22-
name: proton-${{ github.ref_name }}.tar.xz
23-
24-
- name: Download ${{ github.ref_name }}.sha512sum artifact
25-
uses: actions/download-artifact@v4
26-
with:
27-
name: proton-${{ github.ref_name }}.sha512sum
28-
29-
- name: Upload ${{ github.ref_name }}.tar.xz to release
30-
uses: svenstaro/upload-release-action@v2
31-
with:
32-
repo_token: ${{ secrets.GITHUB_TOKEN }}
33-
tag: ${{ github.ref_name }}
34-
file: proton-${{ github.ref_name }}.tar.xz
35-
overwrite: false
36-
37-
- name: Upload ${{ github.ref_name }}.sha512sum to release
38-
uses: svenstaro/upload-release-action@v2
39-
with:
40-
repo_token: ${{ secrets.GITHUB_TOKEN }}
41-
tag: ${{ github.ref_name }}
42-
file: proton-${{ github.ref_name }}.sha512sum
43-
overwrite: false
33+
uses: ./.github/workflows/upload.yml
34+
with:
35+
name: ${{ matrix.name }}

.github/workflows/devel.yml renamed to .github/workflows/snapshot.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Development
1+
name: Snapshot
22

33
on:
44
workflow_dispatch:
@@ -32,10 +32,20 @@ jobs:
3232
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
3333
3434
build:
35+
strategy:
36+
matrix:
37+
include:
38+
- name: proton-${{ needs.version.outputs.full_desc }}-x86_64
39+
cpu_arch: nocona
40+
cpu_tune: core-avx2
41+
- name: proton-${{ needs.version.outputs.full_desc }}-x86_64_v3
42+
cpu_arch: core-avx2
43+
cpu_tune: core-avx2
3544
needs: version
3645
name: Build
3746
uses: ./.github/workflows/build.yml
3847
with:
39-
name: proton-${{ needs.version.outputs.full_desc }}-${{ needs.version.outputs.branch }}
40-
48+
name: ${{ matrix.name }}
49+
cpu_arch: ${{ matrix.cpu_arch }}
50+
cpu_tune: ${{ matrix.cpu_tune }}
4151

.github/workflows/upload.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Upload
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
name:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
upload:
12+
name: Upload ${{ inputs.name }}
13+
strategy:
14+
matrix:
15+
include:
16+
- file: ${{ inputs.name }}.tar.xz
17+
- file: ${{ inputs.name }}.sha512sum
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Download ${{ matrix.file }} artifact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: ${{ matrix.file }}
24+
25+
- name: Upload ${{ matrix.file }} to release
26+
uses: svenstaro/upload-release-action@v2
27+
with:
28+
repo_token: ${{ secrets.GITHUB_TOKEN }}
29+
tag: ${{ github.ref_name }}
30+
file: ${{ matrix.file }}
31+
overwrite: false

0 commit comments

Comments
 (0)