From 8d6a095ba5a5155558852c0178dc5f1376174d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 8 Mar 2022 03:11:15 +0000 Subject: [PATCH 1/2] Improve CI config --- .github/workflows/release.yml | 92 ++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1371e1..5405279 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,79 +11,95 @@ jobs: outputs: matrix: ${{ steps.matrix.outputs.s6_arch }} steps: - - uses: actions/checkout@v2 - - id: matrix + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up build matrix + id: matrix run: | echo '::set-output name=s6_arch::'$(cut -f1 conf/toolchains | sed -z '$ s/\n$//' | jq -R -s -c 'split("\n")') + - name: Create release notes - run: | . conf/versions - printf "Binary releases include the following packages:\n\n" > release-notes.md - printf "| Software | Version |\n" >> release-notes.md - printf "| -------- |:-------:|\n" >> release-notes.md - printf "| BearSSL | %s \n" "${BEARSSL_VERSION}" >> release-notes.md - printf "| skalibs | %s \n" "${SKALIBS_VERSION}" >> release-notes.md - printf "| execline | %s \n" "${EXECLINE_VERSION}" >> release-notes.md - printf "| s6 | %s \n" "${S6_VERSION}" >> release-notes.md - printf "| s6-rc | %s \n" "${S6_RC_VERSION}" >> release-notes.md - printf "| s6-linux-init | %s \n" "${S6_LINUX_INIT_VERSION}" >> release-notes.md - printf "| s6-portable-utils | %s \n" "${S6_PORTABLE_UTILS_VERSION}" >> release-notes.md - printf "| s6-linux-utils | %s \n" "${S6_LINUX_UTILS_VERSION}" >> release-notes.md - printf "| s6-dns | %s \n" "${S6_DNS_VERSION}" >> release-notes.md - printf "| s6-networking | %s \n" "${S6_NETWORKING_VERSION}" >> release-notes.md - printf "| s6-overlay-helpers | %s \n" "${S6_OVERLAY_HELPERS_VERSION}" >> release-notes.md - printf "\n" >> release-notes.md + cat << EOF > release-notes.md + Binary releases include the following packages: + + | Software | Version | + | -------- |:-------:| + | BearSSL | ${BEARSSL_VERSION} | + | skalibs | ${SKALIBS_VERSION} | + | execline | ${EXECLINE_VERSION} | + | s6 | ${S6_VERSION} | + | s6-rc | ${S6_RC_VERSION} | + | s6-linux-init | ${S6_LINUX_INIT_VERSION} | + | s6-portable-utils | ${S6_PORTABLE_UTILS_VERSION} | + | s6-linux-utils | ${S6_LINUX_UTILS_VERSION} | + | s6-dns | ${S6_DNS_VERSION} | + | s6-networking | ${S6_NETWORKING_VERSION} | + | s6-overlay-helpers | ${S6_OVERLAY_HELPERS_VERSION} | + + EOF - - uses: ncipollo/release-action@v1 + - name: Create new release + uses: ncipollo/release-action@v1 with: omitBodyDuringUpdate: true allowUpdates: true bodyFile: release-notes.md release: - needs: [ setup ] + needs: + - setup runs-on: ubuntu-latest strategy: matrix: - s6_arch: ${{fromJson(needs.setup.outputs.matrix)}} + s6_arch: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - # normalize version (remove 'git/refs/', remove leading 'v') - - run: | + # remove 'git/refs/', remove leading 'v' + - name: Normalize version + run: | VERSION="${GITHUB_REF##*/}" - VERSION="${VERSION#v}" - echo "S6_VERSION=${VERSION}" >> $GITHUB_ENV + echo "S6_VERSION=${VERSION#v}" >> "${GITHUB_ENV}" - # create short arch name - - run: | + - name: Create short arch name + run: | HW=$(echo "${{ matrix.s6_arch }}" | cut -f1 -d'-') - if [ "${{matrix.s6_arch}}" = "arm-linux-musleabihf" ] ; then + if [ "${{matrix.s6_arch}}" == "arm-linux-musleabihf" ]; then HW="armhf" fi - echo "S6_HW=${HW}" >> $GITHUB_ENV + echo "S6_HW=${HW}" >> "${GITHUB_ENV}" - - run: | + - name: Build + run: | make ARCH="${{ matrix.s6_arch }}" VERSION="${{ env.S6_VERSION }}" - - run: | - cd output ; for f in *.tar* ; do sha256sum "$f" > "$f".sha256 ; done + - name: Create hashes + run: | + cd output + for f in *.tar*; do + sha256sum "$f" > "${f}.sha256" + done - # output arch-specific binary - - uses: ncipollo/release-action@v1 + - name: Output arch-specific binary + uses: ncipollo/release-action@v1 with: artifacts: "output/s6-overlay-${{ env.S6_HW }}*" omitBodyDuringUpdate: true allowUpdates: true - - run: | + - name: Cleanup + run: | rm -v output/s6-overlay-${{ env.S6_HW }}* - # upload symlinks/non-arch on x86_64 only - - uses: ncipollo/release-action@v1 + - name: Upload symlinks/non-arch on x86_64 only + if: ${{ matrix.s6_arch == 'x86_64-linux-musl' }} + uses: ncipollo/release-action@v1 with: artifacts: "output/*.tar.*" omitBodyDuringUpdate: true allowUpdates: true - if: ${{ matrix.s6_arch == 'x86_64-linux-musl' }} From 1859e7e0aa46e02ccd3b412d35d4e3cde93bb0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 8 Mar 2022 12:12:03 +0000 Subject: [PATCH 2/2] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5405279..4718fff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: - name: Create short arch name run: | HW=$(echo "${{ matrix.s6_arch }}" | cut -f1 -d'-') - if [ "${{matrix.s6_arch}}" == "arm-linux-musleabihf" ]; then + if [ "${{matrix.s6_arch}}" = "arm-linux-musleabihf" ]; then HW="armhf" fi echo "S6_HW=${HW}" >> "${GITHUB_ENV}"