Skip to content

Commit

Permalink
Merge branch 'cachyos_9.0_20250227/_action' into cachyos_9.0_20250227…
Browse files Browse the repository at this point in the history
…/main-runtime
  • Loading branch information
loathingKernel committed Mar 1, 2025
2 parents e039fda + e8f8a3c commit f89b6a8
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/_job_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: _job_build

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

jobs:
proton:
name: Build ${{ 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@v4
with:
path: ~/.ccache
key: ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}-${{ github.run_id }}
restore-keys: |
ccache-proton-${{ inputs.cpu_arch }}-${{ inputs.cpu_tune }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: recursive

- name: Patch
run: |
./patches/apply.sh
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
- name: Make ${{ inputs.name }}
working-directory: ./build
run: |
make -j$(nproc) redist
- name: Upload artifact ${{ inputs.name }}.tar.xz
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}.tar.xz
path: ./build/${{ inputs.name }}.tar.xz

- name: Upload artifact ${{ inputs.name }}.sha512sum
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}.sha512sum
path: ./build/${{ inputs.name }}.sha512sum

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

on:
workflow_call:
inputs:
version:
required: true
type: string
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
shell: bash
run: >-
gh
--repo "${{ github.server_url }}/${{ github.repository }}"
release upload
${{ inputs.version }}
${{ matrix.file }}
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
release:
types: [ published ]
push:
tags:
- 'cachyos-*-*-slr'

jobs:
build:
name: 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
uses: ./.github/workflows/_job_build.yml
with:
name: ${{ matrix.name }}
cpu_arch: ${{ matrix.cpu_arch }}
cpu_tune: ${{ matrix.cpu_tune }}

release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Title
id: title
shell: bash
run: |
git fetch origin +refs/tags/*:refs/tags/*
python -c "_,mj,mn,_='${{ github.ref_name }}'.split('-');print('title='+'-'.join([mj,mn]))" >> "$GITHUB_OUTPUT"
- name: Create
id: create
shell: bash
run: >-
gh
release create
${{ github.ref_name }}
--latest
--title "Version ${{ steps.title.outputs.title }}"
--notes-from-tag
--verify-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

upload:
name: Upload
needs: release
strategy:
matrix:
include:
- name: proton-${{ github.ref_name }}-x86_64
- name: proton-${{ github.ref_name }}-x86_64_v3
uses: ./.github/workflows/_job_upload.yml
with:
version: ${{ github.ref_name }}
name: ${{ matrix.name }}
51 changes: 51 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Snapshot

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:
name: Build
needs: version
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
uses: ./.github/workflows/_job_build.yml
with:
name: ${{ matrix.name }}
cpu_arch: ${{ matrix.cpu_arch }}
cpu_tune: ${{ matrix.cpu_tune }}

0 comments on commit f89b6a8

Please sign in to comment.