Skip to content

Commit

Permalink
workflows: add multiple build targets
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel committed Feb 22, 2025
1 parent cb22987 commit 6eca61a
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 38 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ on:
name:
required: true
type: string
cpu_arch:
required: true
type: string
cpu_tune:
required: true
type: string

jobs:
proton:
name: ${{ inputs.name }}
name: Build ${{ inputs.name }}
runs-on: ubuntu-latest
steps:
- name: Prepare host
Expand All @@ -19,9 +25,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-proton-${{ github.run_id }}
key: ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}-${{ github.run_id }}
restore-keys: |
ccache-proton
ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,15 +38,19 @@ jobs:

- name: Patch
run: |
sed 's/-march=nocona/-march=${{ inputs.cpu_arch }}/g' -i Makefile.in
sed 's/-mtune=core-avx2/-mtune=${{ inputs.cpu_tune }}/g' -i Makefile.in
mkdir ./build
- name: Configure
working-directory: ./build
run: ../configure.sh --build-name=${{ inputs.name }} --enable-ccache --container-engine=docker
run: |
../configure.sh --build-name=${{ inputs.name }} --enable-ccache --container-engine=docker
- name: Make ${{ inputs.name }}
working-directory: ./build
run: make -j3 redist
run: |
make -j$(nproc) redist
- name: Upload artifact ${{ inputs.name }}.tar.xz
uses: actions/upload-artifact@v4
Expand All @@ -53,3 +63,4 @@ jobs:
with:
name: ${{ inputs.name }}.sha512sum
path: ./build/${{ inputs.name }}.sha512sum

52 changes: 22 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,30 @@ on:

jobs:
build:
strategy:
matrix:
include:
- name: proton-${{ github.ref_name }}-x86_64
cpu_arch: nocona
cpu_tune: core-avx2
- name: proton-${{ github.ref_name }}-x86_64_v3
cpu_arch: core-avx2
cpu_tune: core-avx2
name: Build
uses: ./.github/workflows/build.yml
with:
name: proton-${{ github.ref_name }}
name: ${{ matrix.name }}
cpu_arch: ${{ matrix.cpu_arch }}
cpu_tune: ${{ matrix.cpu_tune }}

release:
name: Release ${{ github.ref_name }}
upload:
strategy:
matrix:
include:
- name: proton-${{ github.ref_name }}-x86_64
- name: proton-${{ github.ref_name }}-x86_64_v3
name: Upload
needs: build
runs-on: ubuntu-latest
steps:
- name: Download ${{ github.ref_name }}.tar.xz artifact
uses: actions/download-artifact@v4
with:
name: proton-${{ github.ref_name }}.tar.xz

- name: Download ${{ github.ref_name }}.sha512sum artifact
uses: actions/download-artifact@v4
with:
name: proton-${{ github.ref_name }}.sha512sum

- name: Upload ${{ github.ref_name }}.tar.xz to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: proton-${{ github.ref_name }}.tar.xz
overwrite: false

- name: Upload ${{ github.ref_name }}.sha512sum to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: proton-${{ github.ref_name }}.sha512sum
overwrite: false
uses: ./.github/workflows/upload.yml
with:
name: ${{ matrix.name }}
16 changes: 13 additions & 3 deletions .github/workflows/devel.yml → .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Development
name: Snapshot

on:
workflow_dispatch:
Expand Down Expand Up @@ -32,10 +32,20 @@ jobs:
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
build:
strategy:
matrix:
include:
- name: proton-${{ needs.version.outputs.full_desc }}-x86_64
cpu_arch: nocona
cpu_tune: core-avx2
- name: proton-${{ needs.version.outputs.full_desc }}-x86_64_v3
cpu_arch: core-avx2
cpu_tune: core-avx2
needs: version
name: Build
uses: ./.github/workflows/build.yml
with:
name: proton-${{ needs.version.outputs.full_desc }}-${{ needs.version.outputs.branch }}

name: ${{ matrix.name }}
cpu_arch: ${{ matrix.cpu_arch }}
cpu_tune: ${{ matrix.cpu_tune }}

31 changes: 31 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload

on:
workflow_call:
inputs:
name:
required: true
type: string

jobs:
upload:
name: Upload ${{ inputs.name }}
strategy:
matrix:
include:
- file: ${{ inputs.name }}.tar.xz
- file: ${{ inputs.name }}.sha512sum
runs-on: ubuntu-latest
steps:
- name: Download ${{ matrix.file }} artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.file }}

- name: Upload ${{ matrix.file }} to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: ${{ matrix.file }}
overwrite: false

0 comments on commit 6eca61a

Please sign in to comment.