Skip to content

Publish tagged QCW release #27

Publish tagged QCW release

Publish tagged QCW release #27

name: Publish tagged QCW release
on:
workflow_dispatch:
inputs:
release_name:
description: 'Release name'
required: true
type: string
release_tag:
description: 'Release tag'
required: true
type: string
release_highlights:
description: 'Release highlights'
default: 'TBD.'
required: true
type: string
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-go-wsllinks:
uses: ./.github/workflows/prepare-go-wsllinks-release.yml
call-prepare-alpine-wsl:
uses: ./.github/workflows/prepare-alpine-wsl-release.yml
call-prepare-lima:
uses: ./.github/workflows/prepare-lima-release.yml
publish:
# needs: [call-prepare-docker, call-prepare-podman, call-prepare-qemu]
needs: [call-prepare-go-wsllinks, call-prepare-alpine-wsl, call-prepare-lima]
runs-on: ubuntu-latest
steps:
- name: "📝 Configure checkout"
run: git config --global core.autocrlf input
- name: "📝 Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "🛻 Donwload artifacts"
uses: actions/download-artifact@v4
with:
path: qcw
- name: "🗒️ Prepare release notes"
env:
ALPINE_VERSION: ${{ needs.call-prepare-alpine-wsl.outputs.alpine_version }}
ALPINEWSL_VERSION: ${{ needs.call-prepare-alpine-wsl.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-go-wsllinks.outputs.gowsllinks_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/<<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"
# uses: ncipollo/release-action@v1
# with:
# name: ${{ inputs.release_name }}
# prerelease: "true"
# artifacts: "qcw/**/*.exe,qcw/**/*.wsl,qcw/*.sha256,qcw/*.sha512"
# bodyFile: "release.template.md"
# tag: ${{ inputs.release_tag }}
# commit: "main"