Skip to content

Commit c510c91

Browse files
committed
.github: new weekly workflow to verify release workflow
Fixes #1003 Signed-off-by: Joachim Wiberg <[email protected]>
1 parent dc62138 commit c510c91

File tree

3 files changed

+179
-72
lines changed

3 files changed

+179
-72
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build Release
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
use_cache:
10+
required: false
11+
type: boolean
12+
default: true
13+
14+
jobs:
15+
build:
16+
name: Build Infix ${{ inputs.version }} [${{ matrix.target }}]
17+
runs-on: [ self-hosted, release ]
18+
strategy:
19+
matrix:
20+
target: [aarch64, x86_64]
21+
fail-fast: false
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
clean: true
26+
submodules: recursive
27+
28+
- name: Set Release Variables
29+
id: vars
30+
run: |
31+
ver=${{ inputs.version }}
32+
echo "ver=${ver}" >> $GITHUB_OUTPUT
33+
fver=${ver#v}
34+
target=${{ matrix.target }}-${fver}
35+
echo "dir=infix-$target" >> $GITHUB_OUTPUT
36+
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
37+
38+
- name: Restore Cache of dl/
39+
if: ${{ inputs.use_cache }}
40+
uses: actions/cache@v4
41+
with:
42+
path: dl/
43+
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
44+
restore-keys: |
45+
dl-
46+
47+
- name: Restore Cache of .ccache/
48+
if: ${{ inputs.use_cache }}
49+
uses: actions/cache@v4
50+
with:
51+
path: .ccache/
52+
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
53+
restore-keys: |
54+
ccache-${{ matrix.target }}-
55+
ccache-
56+
57+
- name: Configure & Build
58+
env:
59+
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
60+
run: |
61+
target=${{ matrix.target }}_defconfig
62+
echo "Building $target ..."
63+
make $target
64+
make
65+
66+
- name: Generate SBOM from Build
67+
run: |
68+
make legal-info
69+
70+
- name: Build test specification
71+
run: |
72+
make test-spec
73+
74+
- name: Prepare Artifacts
75+
run: |
76+
cd output/
77+
mv images ${{ steps.vars.outputs.dir }}
78+
ln -s ${{ steps.vars.outputs.dir }} images
79+
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
80+
81+
mv legal-info legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
82+
tar cfz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}.tar.gz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
83+
84+
- uses: actions/upload-artifact@v4
85+
with:
86+
name: artifact-${{ matrix.target }}
87+
path: output/*.tar.gz
88+
89+
- uses: actions/upload-artifact@v4
90+
with:
91+
name: artifact-disk-image-${{ matrix.target }}
92+
path: output/images/*.qcow2

.github/workflows/release.yml

Lines changed: 12 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -18,87 +18,27 @@ on:
1818
type: string
1919

2020
jobs:
21-
build:
21+
set-version:
2222
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
23-
name: Build Infix ${{ github.ref_name }} [${{ matrix.target }}]
24-
runs-on: [ self-hosted, release ]
25-
strategy:
26-
matrix:
27-
target: [aarch64, x86_64]
28-
fail-fast: false
23+
runs-on: ubuntu-latest
24+
outputs:
25+
version: ${{ steps.set-ver.outputs.version }}
2926
steps:
30-
- uses: actions/checkout@v4
31-
with:
32-
clean: true
33-
submodules: recursive
34-
35-
- name: Set Release Variables
36-
id: vars
27+
- id: set-ver
3728
run: |
3829
if [ -n "${{ inputs.version }}" ]; then
3930
ver=${{ inputs.version }}
4031
else
4132
ver=${GITHUB_REF#refs/tags/}
4233
fi
43-
echo "ver=${ver}" >> $GITHUB_OUTPUT
44-
fver=${ver#v}
45-
target=${{ matrix.target }}-${fver}
46-
echo "dir=infix-$target" >> $GITHUB_OUTPUT
47-
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
48-
49-
- name: Restore Cache of dl/
50-
uses: actions/cache@v4
51-
with:
52-
path: dl/
53-
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
54-
restore-keys: |
55-
dl-
56-
57-
- name: Restore Cache of .ccache/
58-
uses: actions/cache@v4
59-
with:
60-
path: .ccache/
61-
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
62-
restore-keys: |
63-
ccache-${{ matrix.target }}-
64-
ccache-
65-
66-
- name: Configure & Build
67-
env:
68-
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
69-
run: |
70-
target=${{ matrix.target }}_defconfig
71-
echo "Building $target ..."
72-
make $target
73-
make
34+
echo "version=${ver}" >> $GITHUB_OUTPUT
7435
75-
- name: Generate SBOM from Build
76-
run: |
77-
make legal-info
78-
79-
- name: Build test specification
80-
run: |
81-
make test-spec
82-
83-
- name: Prepare Artifacts
84-
run: |
85-
cd output/
86-
mv images ${{ steps.vars.outputs.dir }}
87-
ln -s ${{ steps.vars.outputs.dir }} images
88-
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
89-
90-
mv legal-info legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
91-
tar cfz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}.tar.gz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
92-
93-
- uses: actions/upload-artifact@v4
94-
with:
95-
name: artifact-${{ matrix.target }}
96-
path: output/*.tar.gz
97-
98-
- uses: actions/upload-artifact@v4
99-
with:
100-
name: artifact-disk-image-${{ matrix.target }}
101-
path: output/images/*.qcow2
36+
build:
37+
needs: set-version
38+
uses: ./.github/workflows/build-release.yml
39+
with:
40+
version: ${{ needs.set-version.outputs.version }}
41+
use_cache: true
10242

10343
release:
10444
name: Release Infix ${{ github.ref_name }}

.github/workflows/weekly.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Weekly release build to catch flaky tests and verify clean builds.
2+
# Runs without caches (ccache) to ensure reproducibility. See issue #1003.
3+
name: Weekly Build
4+
5+
on:
6+
schedule:
7+
- cron: '5 0 * * 6' # Saturday at 00:05 UTC, same as Coverity
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
if: github.repository == 'kernelkit/infix'
13+
uses: ./.github/workflows/build-release.yml
14+
with:
15+
version: "latest"
16+
use_cache: false
17+
18+
publish:
19+
name: Publish Weekly Build
20+
needs: build
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/download-artifact@v4
26+
with:
27+
pattern: "artifact-*"
28+
merge-multiple: true
29+
30+
- name: Create checksums
31+
run: |
32+
for file in *.tar.gz; do
33+
sha256sum $file > $file.sha256
34+
done
35+
if ls *.qcow2 &>/dev/null; then
36+
for file in *.qcow2; do
37+
sha256sum "$file" > "$file.sha256"
38+
done
39+
fi
40+
41+
- name: Update latest tag
42+
run: |
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git tag -f latest
46+
git push -f origin latest
47+
48+
- uses: ncipollo/release-action@v1
49+
with:
50+
tag: latest
51+
name: "Latest Weekly Build"
52+
prerelease: true
53+
makeLatest: false
54+
allowUpdates: true
55+
removeArtifacts: true
56+
body: |
57+
Automated weekly build from `${{ github.sha }}`.
58+
59+
This build runs without caches to catch potential flaky tests and build issues.
60+
Not intended for production use - use official releases instead.
61+
62+
**Commit:** ${{ github.sha }}
63+
**Built:** ${{ github.run_id }}
64+
artifacts: "*.tar.gz*,*.qcow2*"
65+
66+
- name: Summary
67+
run: |
68+
cat <<EOF >> $GITHUB_STEP_SUMMARY
69+
# Weekly Build Published! :package:
70+
71+
Latest artifacts uploaded to:
72+
<https://github.com/kernelkit/infix/releases/tag/latest>
73+
74+
Built from commit: \`${{ github.sha }}\`
75+
EOF

0 commit comments

Comments
 (0)