mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 20:23:01 +02:00
95 lines
3.1 KiB
YAML
95 lines
3.1 KiB
YAML
name: Bob the Builder
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
types:
|
|
- closed
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
if: ${{github.ref_name == 'main' && github.event_name == 'push'}} || github.event_name == 'workflow_dispatch'
|
|
name: Build ${{ matrix.platform }} ${{ matrix.variant }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
platform: [aarch64, x86_64]
|
|
variant: [netconf, classic]
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set Build Variables
|
|
id: vars
|
|
run: |
|
|
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
|
target=${{ matrix.platform }}
|
|
else
|
|
target=${{ matrix.platform }}-${{ matrix.variant }}
|
|
fi
|
|
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
|
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
|
- name: Restore Cache of dl/
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: dl/
|
|
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
|
|
restore-keys: |
|
|
dl-${{ matrix.platform }}-${{ matrix.variant }}-
|
|
dl-${{ matrix.platform }}-
|
|
dl-
|
|
- name: Restore Cache of .ccache/
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .ccache/
|
|
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
|
|
restore-keys: |
|
|
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
|
|
ccache-${{ matrix.platform }}-
|
|
ccache-
|
|
- name: Configure & Build
|
|
run: |
|
|
if [ "${{ matrix.variant }}" = "netconf" ]; then
|
|
target=${{ matrix.platform }}_defconfig
|
|
else
|
|
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
|
|
fi
|
|
echo "Buildring $target ..."
|
|
make $target
|
|
make
|
|
- name: Prepare Artifact
|
|
run: |
|
|
cd output
|
|
mv images ${{ steps.vars.outputs.dir }}
|
|
ln -s ${{ steps.vars.outputs.dir }} images
|
|
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
|
|
- name: Test
|
|
if: matrix.platform == 'x86_64' && matrix.variant == 'netconf'
|
|
run: |
|
|
make test-qeneth
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: output/${{ steps.vars.outputs.tgz }}
|
|
release:
|
|
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
|
|
name: Upload Latest Build
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
- uses: pyTooling/Actions/releaser@main
|
|
with:
|
|
tag: latest
|
|
rm: true
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
files: artifact/*
|
|
- name: Summary
|
|
run: |
|
|
cat <<EOF >> $GITHUB_STEP_SUMMARY
|
|
# Latest Build Complete! :rocket:
|
|
|
|
For the public download links of these build artifacts, please see:
|
|
<https://github.com/kernelkit/infix/releases/tag/latest>
|
|
EOF
|