Initial Commit
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# SPDX-FileCopyrightText: 2026 Christian Tosta
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# @file .github/workflows/build.yml
|
||||
# @brief Simplified master workflow using CMake workflows
|
||||
|
||||
name: Pyenv Build & Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
release-ci:
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
VERSION: ${{ steps.step_getlatest_tag.outputs.VERSION }}
|
||||
steps:
|
||||
- name: Checkout local
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
sparse-checkout: |
|
||||
.github/workflows
|
||||
|
||||
- name: Install build dependencies
|
||||
run: sudo apt-get install git -y -qq
|
||||
|
||||
- name: Get latest pyenv release tag
|
||||
id: step_getlatest_tag
|
||||
run: |
|
||||
latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/pyenv/pyenv '*.*' \
|
||||
| tail --lines=1 | cut --delimiter='/' --fields=3)
|
||||
|
||||
test ! -z "$latest_tag" && echo "LATEST_TAG=$latest_tag" >> "$GITHUB_ENV" || exit 1
|
||||
echo "VERSION=$(echo $latest_tag | sed 's/v//')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Save version
|
||||
run: echo ${{ steps.step_getlatest_tag.outputs.VERSION }} > VERSION
|
||||
|
||||
- name: Upload version
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: VERSION
|
||||
path: VERSION
|
||||
retention-days: 1
|
||||
|
||||
debian:
|
||||
needs: release-ci
|
||||
uses: ./.github/workflows/targets/debian.yml
|
||||
with:
|
||||
containers: "['debian:trixie','debian:bookworm']"
|
||||
|
||||
fedora:
|
||||
needs: release-ci
|
||||
uses: ./.github/workflows/targets/fedora.yml
|
||||
with:
|
||||
containers: "['fedora:44','fedora:45','fedora:latest']"
|
||||
|
||||
publish:
|
||||
needs: [debian, fedora]
|
||||
uses: ./.github/workflows/release.yml
|
||||
@@ -0,0 +1,34 @@
|
||||
# SPDX-FileCopyrightText: 2026 Christian Tosta
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
name: Publish release
|
||||
|
||||
on: workflow_call
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get version
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: VERSION
|
||||
|
||||
- name: Set version
|
||||
run: echo "VERSION=$(cat VERSION | xargs)" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: pyenv-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
*.deb
|
||||
*.rpm
|
||||
@@ -0,0 +1,38 @@
|
||||
# SPDX-FileCopyrightText: 2026 Christian Tosta
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# @file .github/workflows/targets/debian.yml
|
||||
# @brief Simplified Debian build target using workflow preset
|
||||
|
||||
name: Debian Build Target
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
containers:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-deb:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
container: ${{ fromJson(inputs.containers) }}
|
||||
container:
|
||||
image: ${{ matrix.container }}
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: apt-get update && apt-get install -y cmake build-essential git dpkg-dev fakeroot
|
||||
|
||||
- name: Run CMake Workflow
|
||||
run: cmake --workflow --preset deb-workflow
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pyenv-deb-${{ matrix.container }}
|
||||
path: build/deb/*.deb
|
||||
@@ -0,0 +1,34 @@
|
||||
# SPDX-FileCopyrightText: 2026 Christian Tosta
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# @file .github/workflows/targets/fedora.yml
|
||||
# @brief Fedora build target with internal container matrix
|
||||
|
||||
name: Fedora Build Target
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build-rpm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
container: [fedora:42, fedora:43, fedora:latest]
|
||||
container:
|
||||
image: ${{ matrix.container }}
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: dnf install -y cmake gcc-c++ make git rpm-build
|
||||
|
||||
- name: Run CMake Workflow
|
||||
run: cmake --workflow --preset rpm-workflow
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pyenv-rpm-${{ matrix.container }}
|
||||
path: build/rpm/*.rpm
|
||||
Reference in New Issue
Block a user