Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arixmkii committed Dec 12, 2024
1 parent de7e572 commit 7dd8e8e
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 15 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/prepare-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,28 @@ name: Prepare QCW Docker (from revision)
on:
workflow_dispatch:
workflow_call:
outputs:
cli_version:
description: "Docker CLI version"
value: ${{ jobs.build.outputs.cli_version }}
compose_version:
description: "Docker Compose version"
value: ${{ jobs.build.outputs.compose_version }}

env:
CLI_GITURL: https://github.com/docker/cli.git
CLI_SHA: bde2b893136c1c7a2894386e4f8743089c89b041 # v27.4.0
CLI_VERSION: 27.4.0
COMPOSE_GITURL: https://github.com/docker/compose.git
COMPOSE_SHA: a8469db83f514a5abe4681c7fee773061f1941c6 # v2.31.0
COMPOSE_VERSION: 2.31.0

jobs:
build:
runs-on: ubuntu-latest
outputs:
cli_version: ${{ steps.make_versions.outputs.cli }}
compose_version: ${{ steps.make_versions.outputs.compose }}

steps:
- name: 🏗️ Install Docker Buildx
Expand Down Expand Up @@ -63,6 +75,12 @@ jobs:
find . -type f \( ! -iname "*.checksums" \) -exec sha256sum -b {} \; > sha.checksums
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "📌 Export versions"
run: |
echo "cli=$CLI_VERSION" >> "$GITHUB_OUTPUT"
echo "compose=$COMPOSE_VERSION" >> "$GITHUB_OUTPUT"
- name: "🚀 Upload artifact"
uses: actions/upload-artifact@v4
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/prepare-podman-release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
name: Prepare QCW Podman (from revision)

on: workflow_dispatch
on:
workflow_dispatch:
workflow_call:
outputs:
podman_version:
description: Podman version"
value: ${{ jobs.build.outputs.podman_version }}

env:
PODMAN_GITURL: https://github.com/containers/podman.git
PODMAN_SHA: 4cbdfde5d862dcdbe450c0f1d76ad75360f67a3c # v5.3.1
PODMAN_VERSION: 5.3.1
PODMAN_REVISION_KIND: prod # prod|dev

jobs:
build:
runs-on: windows-latest
outputs:
podman_version: ${{ steps.make_versions.outputs.podman }}

steps:
- name: "🏗️ Install msys2"
Expand Down Expand Up @@ -102,6 +111,12 @@ jobs:
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "📌 Export versions"
shell: msys2 {0}
run: |
echo "podman=$PODMAN_VERSION" >> "$GITHUB_OUTPUT"
- name: "🚀 Upload artifact"
uses: actions/upload-artifact@v4
with:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/prepare-qemu-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Prepare QCW QEMU (from TarBall sources)

on: workflow_dispatch
on:
workflow_dispatch:
workflow_call:
outputs:
qemu_version:
description: QEMU version"
value: ${{ jobs.build.outputs.qemu_version }}

env:
QEMU_VERSION: 9.2.0
Expand All @@ -9,6 +15,8 @@ env:
jobs:
build:
runs-on: windows-latest
outputs:
qemu_version: ${{ steps.make_versions.outputs.qemu }}

steps:
- name: "🏗️ Install msys2"
Expand Down Expand Up @@ -113,6 +121,12 @@ jobs:
find . -type f \( ! -iname "*.checksums" \) -exec sha512sum -b {} \; >> sha.checksums
cat sha.checksums
- id: make_versions
name: "📌 Export versions"
shell: msys2 {0}
run: |
echo "qemu=$QEMU_VERSION" >> "$GITHUB_OUTPUT"
- name: "🚀 Upload artifact"
uses: actions/upload-artifact@v4
with:
Expand Down
54 changes: 42 additions & 12 deletions .github/workflows/publish-qcw-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,33 @@ name: Publish tagged QCW release

on:
workflow_dispatch:
release_name:
description: 'Release name'
required: true
type: string
release_tag:
description: 'Release tag'
required: true
type: string
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

prepare:
needs: call-prepare-docker
call-prepare-podman:
uses: ./.github/workflows/prepare-podman-release.yml

call-prepare-qemu:
uses: ./.github/workflows/prepare-qemu-release.yml

publish:
needs: [call-prepare-docker, call-prepare-podman, call-prepare-qemu]
runs-on: ubuntu-latest

steps:
Expand All @@ -34,8 +46,26 @@ jobs:
path: qcw

- name: "🗒️ Prepare release notes"
env:
DOCKER_VERSION: ${{ needs.call-prepare-docker.outputs.cli_version }}
DOCKER_COMPOSE_VERSION: ${{ needs.call-prepare-docker.outputs.compose_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: |
sed 's/<<TAG_NAME>>/${{ inputs.release_tag }}/g' release.template.md
cat ./*/*/sha.checksums | awk '{ print length, $0 }' | sort -n | cut -d" " -f2- > sha.sums
ARTSIZE=`cat sha.sums | wc -l`
ARTSIZE2=$((ARTSIZE / 2))
sed -e "s/<<SHA256>>/$(head -n $ARTSIZE2 sha.sums | sort -k 2 | sed -z 's:\n:\\n:g' | sed 's:/:\\/:g')/g" -i release.template.md
sed -e "s/<<SHA512>>/$(tail -n $ARTSIZE2 sha.sums | sort -k 2 | 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/<<DOCKER_VERSION>>/$DOCKER_VERSION/g" -i release.template.md
sed "s/<<DOCKER_COMPOSE_VERSION>>/$DOCKER_COMPOSE_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
- name: "🏷️ Publish release"
uses: ncipollo/release-action@v1
Expand All @@ -45,4 +75,4 @@ jobs:
artifacts: "qcw/**/*.exe"
bodyFile: "release.template.md"
tag: ${{ inputs.release_tag }}
commit: "update-workflows"
commit: "main"
5 changes: 4 additions & 1 deletion release.template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Highlights
TBD.
<<RELEASE_HIGHLIGHTS>>

#### Included in this release
* QEMU `<<QEMU_VERSION>>` (this one includes 9pfs on Windows hosts patches and UEFI pflash fixes, if this functionality is not needed, then consider using official installer)
Expand All @@ -26,3 +26,6 @@ iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercon
```
<<SHA512>>
```

#### Build log
Build log is available for 90 days at <<BUILD_LOG_URL>>

0 comments on commit 7dd8e8e

Please sign in to comment.