Skip to content

Commit

Permalink
Add Github Actions workflow to build on top of the Steam Linux Runtime
Browse files Browse the repository at this point in the history
* Add reusable Build workflow to build proton
* Add Release workflow to build and release proton when a release is published
* Add Development workflow with manual dispatch only
  • Loading branch information
loathingKernel committed Dec 31, 2024
1 parent 0723c91 commit c5aa09e
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

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

jobs:
proton:
name: ${{ inputs.name }}
runs-on: ubuntu-latest
steps:
- name: Prepare host
run: sudo apt update && sudo apt-get install -y ccache fontforge-nox

- name: Download cache
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-proton-${{ github.run_id }}
restore-keys: |
ccache-proton
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: recursive

- name: Patch
run: |
mkdir ./build
- name: Configure
working-directory: ./build
run: ../configure.sh --build-name=${{ inputs.name }} --enable-ccache --container-engine=docker

- name: Make ${{ inputs.name }}
working-directory: ./build
run: make -j3 redist

- name: Upload artifact ${{ inputs.name }}.tar.gz
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}.tar.gz
path: ./build/${{ inputs.name }}.tar.gz

- name: Upload artifact ${{ inputs.name }}.sha512sum
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}.sha512sum
path: ./build/${{ inputs.name }}.sha512sum
41 changes: 41 additions & 0 deletions .github/workflows/devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Development

on:
workflow_dispatch:

jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
tag_abbrev: ${{ steps.version.outputs.tag_abbrev }}
tag_offset: ${{ steps.version.outputs.tag_offset }}
sha_short: ${{ steps.version.outputs.sha_short }}
full_desc: ${{ steps.version.outputs.full_desc }}
branch: ${{ steps.version.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Version
id: version
shell: bash
run: |
tag_abbrev=$(git describe --tags --abbrev=0)
echo "tag_abbrev=$tag_abbrev" >> $GITHUB_OUTPUT
echo "tag_offset=$(git rev-list $tag_abbrev..HEAD --count)" >> $GITHUB_OUTPUT
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "full_desc=$(git describe --long --tags)" >> $GITHUB_OUTPUT
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
build:
needs: version
name: Build
uses: ./.github/workflows/build.yml
with:
name: proton-${{ needs.version.outputs.full_desc }}-${{ needs.version.outputs.branch }}


43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
release:
types: [ published ]

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
with:
name: proton-${{ github.ref_name }}

release:
name: Release ${{ github.ref_name }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Download ${{ github.ref_name }}.tar.gz artifact
uses: actions/download-artifact@v3
with:
name: proton-${{ github.ref_name }}.tar.gz

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

- name: Upload ${{ github.ref_name }}.tar.gz to release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: proton-${{ github.ref_name }}.tar.gz
overwrite: false

- name: Upload ${{ github.ref_name }}.sha512sum to release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: proton-${{ github.ref_name }}.sha512sum
overwrite: false

0 comments on commit c5aa09e

Please sign in to comment.