From 06365fa3daaacec4d06227541cca8b5fdf9c823e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 29 Feb 2024 07:47:54 +0100 Subject: [PATCH] .github: sync release job with latest changes - Cleanup any docker images to free up space - Build on /mnt - Update artifacts: pattern after API changes - Add .sha256 checksums to each release tarball Signed-off-by: Joachim Wiberg --- .github/workflows/release.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfbf7174..0d0b3679 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,9 +28,14 @@ jobs: variant: [netconf, classic] fail-fast: false steps: + - name: Maintenance + run: | + docker image prune -af + docker volume prune -f + docker container prune -f - uses: actions/checkout@v4 - name: Set Release Variables - id: build + id: vars run: | if [ -n "${{ inputs.version }}" ]; then ver=${{ inputs.version }} @@ -51,6 +56,7 @@ jobs: fi echo "dir=infix-$target" >> $GITHUB_OUTPUT echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT + echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT - name: Restore Cache of dl/ uses: actions/cache@v4 with: @@ -69,36 +75,46 @@ jobs: ccache- - name: Configure & Build env: - INFIX_RELEASE: ${{ steps.build.outputs.ver }} + INFIX_RELEASE: ${{ steps.vars.outputs.ver }} run: | if [ "${{ matrix.variant }}" = "netconf" ]; then target=${{ matrix.platform }}_defconfig else target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig fi - echo "Buildring $target ..." + echo "Building $target ..." + sudo mkdir ${{ steps.vars.outputs.out }} + sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }} + export O=${{ steps.vars.outputs.out }} make $target make - name: Prepare Artifact run: | - cd output - mv images ${{ steps.build.outputs.dir }} - ln -s ${{ steps.build.outputs.dir }} images - tar chfz ${{ steps.build.outputs.tgz }} ${{ steps.build.outputs.dir }} + cd ${{ steps.vars.outputs.out }} + mv images ${{ steps.vars.outputs.dir }} + ln -s ${{ steps.vars.outputs.dir }} images + tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }} - uses: actions/upload-artifact@v4 with: - path: output/${{ steps.build.outputs.tgz }} + path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }} name: artifact-${{ matrix.variant }}-${{ matrix.platform }} release: name: Release Infix ${{ github.ref_name }} needs: build runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: pattern: "artifact-*" merge-multiple: true + - name: Create checksums ... + run: | + for file in *.tar.gz; do + sha256sum $file > $file.sha256 + done - name: Extract ChangeLog entry ... run: | awk '/^-----*$/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \ @@ -109,7 +125,7 @@ jobs: name: Infix ${{ github.ref_name }} prerelease: ${{ needs.build.outputs.pre }} bodyFile: release.md - artifacts: artifact/* + artifacts: "*.tar.gz*" - name: Summary run: | cat <> $GITHUB_STEP_SUMMARY