mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
143 lines
4.1 KiB
YAML
143 lines
4.1 KiB
YAML
name: Build packages
|
|
|
|
on:
|
|
push:
|
|
branches: ['master']
|
|
tags: '*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-packages:
|
|
strategy:
|
|
matrix:
|
|
target-os: [ debian-12, ubuntu-2204, ubuntu-2404, fedora-39, fedora-40, fedora-41, arch, opensuse-tumbleweed ]
|
|
recipe: [ lact, lact-headless ]
|
|
include:
|
|
- target-os: fedora-39
|
|
recipe: lact-libadwaita
|
|
- target-os: fedora-40
|
|
recipe: lact-libadwaita
|
|
- target-os: fedora-41
|
|
recipe: lact-libadwaita
|
|
- target-os: arch
|
|
recipe: lact-libadwaita
|
|
- target-os: opensuse-tumbleweed
|
|
recipe: lact-libadwaita
|
|
- target-os: rhel-8
|
|
recipe: lact-headless
|
|
- target-os: rhel-9
|
|
recipe: lact-headless
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Import gpg key
|
|
run: |
|
|
echo -n "$GPG_KEY" | base64 -d > /tmp/package-signing-key.gpg
|
|
echo -n "$GPG_KEY" | base64 -d | gpg --import || true
|
|
env:
|
|
GPG_KEY: ${{ secrets.GPG_KEY }}
|
|
|
|
- name: Install pkger
|
|
run: |
|
|
curl -L -o /usr/local/bin/pkger https://github.com/ilya-zlobintsev/pkger/releases/download/v0.11.1/pkger
|
|
chmod +x /usr/local/bin/pkger
|
|
|
|
- name: Build packages (with signing)
|
|
if: ${{ contains(matrix.target-os, 'fedora') && env.GPG_KEY_PASSWORD != '' }}
|
|
run: pkger -t -c .pkger.yml build ${{ matrix.recipe }} -i ${{ matrix.target-os }}
|
|
env:
|
|
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
|
|
|
|
- name: Build packages (without signing)
|
|
if: ${{ !contains(matrix.target-os, 'fedora') }}
|
|
run: pkger -t -c .pkger.yml build --no-sign ${{ matrix.recipe }} -i ${{ matrix.target-os }}
|
|
|
|
- name: Copy release files
|
|
run: |
|
|
OUT_DIR=$PWD/release-artifacts
|
|
mkdir -p $OUT_DIR
|
|
|
|
pushd pkg/output
|
|
for DISTRO in $(ls); do
|
|
cd $DISTRO
|
|
rm -f *.src.rpm
|
|
|
|
for FILE in $(ls); do
|
|
NAME="${FILE%.*}"
|
|
EXT="${FILE##*.}"
|
|
|
|
OUT_NAME="$OUT_DIR/$NAME.$DISTRO.$EXT"
|
|
cp $FILE $OUT_NAME
|
|
done
|
|
cd ..
|
|
done
|
|
popd
|
|
|
|
- name: Save gpg key
|
|
run: |
|
|
gpg --armor --export > $PWD/release-artifacts/lact.pubkey
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.target-os }}-${{ matrix.recipe }}
|
|
path: release-artifacts/*
|
|
|
|
create-test-release:
|
|
needs: build-packages
|
|
runs-on: ubuntu-latest
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: downloaded-artifacts/
|
|
|
|
- name: Create release
|
|
uses: ncipollo/release-action@v1.12.0
|
|
with:
|
|
removeArtifacts: true
|
|
allowUpdates: true
|
|
artifactErrorsFailBuild: false
|
|
artifacts: "downloaded-artifacts/*/*"
|
|
body: ${{ github.event.head_commit.message }}
|
|
prerelease: true
|
|
name: Test release
|
|
tag: test-build
|
|
|
|
- name: Update test-build tag
|
|
run: |
|
|
git tag -f test-build
|
|
git push -f origin test-build
|
|
shell: bash
|
|
|
|
|
|
create-stable-release:
|
|
needs: build-packages
|
|
runs-on: ubuntu-latest
|
|
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: downloaded-artifacts/
|
|
|
|
- name: Create release
|
|
uses: ncipollo/release-action@v1.12.0
|
|
with:
|
|
artifacts: "downloaded-artifacts/*/*"
|
|
name: ${{ github.ref_name }}
|
|
tag: ${{ github.ref_name }}
|
|
body: ${{ github.ref_name }} changelog goes here
|
|
draft: true
|