|
| 1 | +name: Release General |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v[0-9]*.*' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + version: |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Building Vendor Example Reference Release ${{ github.ref_name }} [${{ matrix.platform }}] |
| 16 | + runs-on: [self-hosted, release] |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + platform: [aarch64, x86_64] |
| 20 | + fail-fast: false |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + clean: true |
| 25 | + submodules: recursive |
| 26 | + |
| 27 | + - name: Set Release Variables |
| 28 | + id: vars |
| 29 | + run: | |
| 30 | + if [ -n "${{ inputs.version }}" ]; then |
| 31 | + ver=${{ inputs.version }} |
| 32 | + else |
| 33 | + ver=${GITHUB_REF#refs/tags/v} |
| 34 | + fi |
| 35 | + echo "ver=${ver}" >> $GITHUB_OUTPUT |
| 36 | + if echo $ver | grep -qE '[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then |
| 37 | + echo "pre=true" >> $GITHUB_OUTPUT |
| 38 | + else |
| 39 | + echo "pre=false" >> $GITHUB_OUTPUT |
| 40 | + fi |
| 41 | + target=${{ matrix.target }}-${ver} |
| 42 | + echo "dir=dcp-sc-28p-$target" >> $GITHUB_OUTPUT |
| 43 | + echo "tgz=dcp-sc-28p-$target.tar.gz" >> $GITHUB_OUTPUT |
| 44 | +
|
| 45 | + - name: Restore Cache of dl/ |
| 46 | + uses: actions/cache@v4 |
| 47 | + with: |
| 48 | + path: dl/ |
| 49 | + key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }} |
| 50 | + restore-keys: | |
| 51 | + dl-${{ matrix.platform }}- |
| 52 | + dl- |
| 53 | +
|
| 54 | + - name: Restore Cache of .ccache/ |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: .ccache/ |
| 58 | + key: ccache-${{ matrix.platform }}-${{ hashFiles('.git/modules/infix/refs/heads/main', 'configs/*') }} |
| 59 | + restore-keys: | |
| 60 | + ccache-${{ matrix.platform }}- |
| 61 | + ccache- |
| 62 | +
|
| 63 | + - name: Configure & Build |
| 64 | + env: |
| 65 | + INFIX_RELEASE: ${{ steps.vars.outputs.ver }} |
| 66 | + run: | |
| 67 | + target=${{ matrix.platform }}_minimal_defconfig |
| 68 | + echo "Buildring $target ..." |
| 69 | + make $target |
| 70 | + make |
| 71 | +
|
| 72 | + - name: Prepare Artifact |
| 73 | + run: | |
| 74 | + cd output |
| 75 | + mv images ${{ steps.vars.outputs.dir }} |
| 76 | + ln -s ${{ steps.vars.outputs.dir }} images |
| 77 | + tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }} |
| 78 | +
|
| 79 | + - uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + path: output/${{ steps.vars.outputs.tgz }} |
| 82 | + name: artifact-${{ matrix.platform }} |
| 83 | + |
| 84 | + release: |
| 85 | + name: Release Infix / Vendor Example ${{ github.ref_name }} |
| 86 | + needs: build |
| 87 | + runs-on: ubuntu-latest |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v4 |
| 90 | + - uses: actions/download-artifact@v4 |
| 91 | + with: |
| 92 | + pattern: "artifact-*" |
| 93 | + merge-multiple: true |
| 94 | + - name: Extract ChangeLog entry ... |
| 95 | + run: | |
| 96 | + awk '/-----*/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \ |
| 97 | + |head -n -1 > release.md |
| 98 | + cat release.md |
| 99 | + - uses: ncipollo/release-action@v1 |
| 100 | + with: |
| 101 | + name: Vendor example Reference Release ${{ github.ref_name }} |
| 102 | + prerelease: ${{ needs.vars.outputs.pre }} |
| 103 | + bodyFile: release.md |
| 104 | + artifacts: "*.tar.gz*" |
| 105 | + - name: Summary |
| 106 | + run: | |
| 107 | + cat <<EOF >> $GITHUB_STEP_SUMMARY |
| 108 | + For the public download links of this release, please see: |
| 109 | + <https://github.com/kernelkit/vendor-example/releases/tag/${{ github.ref_name }}> |
| 110 | + EOF |
0 commit comments