Publish tagged QCW release #74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish tagged QCW release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_name: | |
| description: 'Release name (noramlly X.Y.Z)' | |
| required: true | |
| type: string | |
| release_tag: | |
| description: 'Release tag (normally vX.Y.Z)' | |
| required: true | |
| type: string | |
| release_highlights: | |
| description: 'Release highlights' | |
| default: 'TBD.' | |
| required: true | |
| type: string | |
| dry_run: | |
| description: "Skip publishing to releases (dry run)" | |
| default: false | |
| required: true | |
| type: boolean | |
| jobs: | |
| call-prepare-docker: | |
| uses: ./.github/workflows/prepare-docker-release.yml | |
| call-prepare-podman: | |
| uses: ./.github/workflows/prepare-podman-release.yml | |
| call-prepare-qemu: | |
| uses: ./.github/workflows/prepare-qemu-release.yml | |
| call-prepare-lima: | |
| uses: ./.github/workflows/prepare-lima-release.yml | |
| publish: | |
| needs: [call-prepare-docker, call-prepare-podman, call-prepare-qemu, call-prepare-lima] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "📝 Configure checkout" | |
| run: git config --global core.autocrlf input | |
| - name: "📝 Checkout" | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| - name: "🛻 Donwload artifacts" | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| path: qcw | |
| - name: "🗒️ Prepare release notes" | |
| env: | |
| ALPINE_VERSION: ${{ needs.call-prepare-lima.outputs.alpine_version }} | |
| ALPINEWSL_VERSION: ${{ needs.call-prepare-lima.outputs.alpine_wsl_version }} | |
| DOCKER_VERSION: ${{ needs.call-prepare-docker.outputs.cli_version }} | |
| DOCKER_COMPOSE_VERSION: ${{ needs.call-prepare-docker.outputs.compose_version }} | |
| GOWSLLINKS_VERSION: ${{ needs.call-prepare-lima.outputs.gowsllinks_version }} | |
| BUNDLES_VERSION: ${{ needs.call-prepare-lima.outputs.bundles_version }} | |
| LIMA_VERSION: ${{ needs.call-prepare-lima.outputs.lima_version }} | |
| PODMAN_VERSION: ${{ needs.call-prepare-podman.outputs.podman_version }} | |
| QEMU_VERSION: ${{ needs.call-prepare-qemu.outputs.qemu_version }} | |
| BUILD_LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| cat ./*/*/sha.checksums | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- > sha.sums | |
| ARTSIZE=`cat sha.sums | wc -l` | |
| ARTSIZE2=$((ARTSIZE / 2)) | |
| head -n $ARTSIZE2 sha.sums | sort -k 2 > qcw/checksums.sha256 | |
| tail -n $ARTSIZE2 sha.sums | sort -k 2 > qcw/checksums.sha512 | |
| sed -e "s/<<SHA256>>/$(cat qcw/checksums.sha256 | sed -z 's:\n:\\n:g' | sed 's:/:\\/:g')/g" -i release.template.md | |
| sed -e "s/<<SHA512>>/$(cat qcw/checksums.sha512 | sed -z 's:\n:\\n:g' | sed 's:/:\\/:g')/g" -i release.template.md | |
| sed 's/<<TAG_NAME>>/${{ inputs.release_tag }}/g' -i release.template.md | |
| sed 's/<<RELEASE_HIGHLIGHTS>>/${{ inputs.release_highlights }}/g' -i release.template.md | |
| sed "s/<<ALPINE_VERSION>>/$ALPINE_VERSION/g" -i release.template.md | |
| sed "s/<<ALPINEWSL_VERSION>>/$ALPINEWSL_VERSION/g" -i release.template.md | |
| sed "s/<<DOCKER_VERSION>>/$DOCKER_VERSION/g" -i release.template.md | |
| sed "s/<<DOCKER_COMPOSE_VERSION>>/$DOCKER_COMPOSE_VERSION/g" -i release.template.md | |
| sed "s/<<GOWSLLINKS_VERSION>>/$GOWSLLINKS_VERSION/g" -i release.template.md | |
| sed "s/<<BUNDLES_VERSION>>/$BUNDLES_VERSION/g" -i release.template.md | |
| sed "s/<<LIMA_VERSION>>/$LIMA_VERSION/g" -i release.template.md | |
| sed "s/<<PODMAN_VERSION>>/$PODMAN_VERSION/g" -i release.template.md | |
| sed "s/<<QEMU_VERSION>>/$QEMU_VERSION/g" -i release.template.md | |
| sed -e "s/<<BUILD_LOG_URL>>/$(echo $BUILD_LOG_URL | sed 's:/:\\/:g')/g" -i release.template.md | |
| cat release.template.md | |
| cat qcw/checksums.sha256 | |
| cat qcw/checksums.sha512 | |
| - name: "🏷️ Publish release" | |
| if: ${{ !inputs.dry_run }} | |
| uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0 | |
| with: | |
| name: ${{ inputs.release_name }} | |
| prerelease: "true" | |
| artifacts: "qcw/**/*.msi,qcw/**/*.exe,qcw/**/*.wsl,qcw/**/*.zip,qcw/*.sha256,qcw/*.sha512" | |
| bodyFile: "release.template.md" | |
| tag: ${{ inputs.release_tag }} | |
| commit: "main" |