From 101a9bc407513ce6902207e5fd679094b25c06eb Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:30:31 +0200 Subject: [PATCH 1/3] ci: replace the suffix of the Docker image tag to use the GitHub short commit sha --- .github/workflows/ci.yml | 6 +++++- .github/workflows/pre-release.yml | 6 +++++- .github/workflows/release.yml | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caf85d2ff4d..45c317c52c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -503,6 +503,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get short SHA + id: slug + run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -523,7 +527,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | unstable - type=raw,value=${{ github.base_ref || github.ref_name }}-{{sha}} + type=raw,value=${{ github.base_ref || github.ref_name }}-${{ steps.slug.outputs.sha8 }} - name: Download built artifacts (Linux-X64) uses: actions/download-artifact@v4 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 3152c609a44..d1cae582b83 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -130,6 +130,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get short SHA + id: slug + run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -150,7 +154,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | pre-release - type=raw,value=${{ github.ref_name }}-{{sha}} + type=raw,value=${{ github.ref_name }}-${{ steps.slug.outputs.sha8 }} - name: Download built artifacts (Linux-x64) uses: dawidd6/action-download-artifact@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6efaccea184..a8e075b4e74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get short SHA + id: slug + run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -51,7 +55,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.PACKAGE }} tags: | latest - type=raw,value=${{ github.ref_name }}-{{sha}} + type=raw,value=${{ github.ref_name }}-${{ steps.slug.outputs.sha8 }} - name: Download built artifacts (Linux-x64) uses: dawidd6/action-download-artifact@v6 From 2ee7ea436d6a29a98b13db39bd07f9866a0ab82d Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 21 Jul 2025 19:37:30 +0200 Subject: [PATCH 2/3] ci: add a `Download a Docker image` section --- .../actions/prepare-distribution/action.yml | 50 ++++++++++++++++--- .github/workflows/ci.yml | 2 +- .github/workflows/pre-release.yml | 2 +- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/.github/workflows/actions/prepare-distribution/action.yml b/.github/workflows/actions/prepare-distribution/action.yml index 31733f5226b..7b4498b8ac9 100644 --- a/.github/workflows/actions/prepare-distribution/action.yml +++ b/.github/workflows/actions/prepare-distribution/action.yml @@ -5,8 +5,8 @@ description: | The artifacts for all supported environments must have been downloaded in "package-{EnvName}-x64" subfolders before calling this action. inputs: - version-name: - description: Name of the version to package + tag: + description: The tag to use for the distribution required: true download-url-base: description: Base url where the released distribution will be downloadable @@ -20,13 +20,28 @@ inputs: runs: using: "composite" steps: + - name: Get short SHA + id: slug + shell: bash + run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + + - name: Compute version name + id: compute-version-name + shell: bash + run: | + if [[ "${{ inputs.tag }}" == "unstable" ]]; then + echo "version-name=unstable-${{ steps.slug.outputs.sha8 }}" >> $GITHUB_OUTPUT + else + echo "version-name=${{ inputs.tag }}" >> $GITHUB_OUTPUT + fi + - name: Package distribution (Linux-X64) shell: bash run: | python3 ./.github/workflows/scripts/package-distribution.py \ --input package-Linux-X64/ \ --dest package/ \ - --version "${{ inputs.version-name }}" \ + --version "${{ steps.compute-version-name.outputs.version-name }}" \ --target "linux-x64" - name: Package distribution (Linux-ARM64) @@ -35,7 +50,7 @@ runs: python3 ./.github/workflows/scripts/package-distribution.py \ --input package-Linux-ARM64/ \ --dest package/ \ - --version "${{ inputs.version-name }}" \ + --version "${{ steps.compute-version-name.outputs.version-name }}" \ --target "linux-arm64" - name: Package distribution (macOS-ARM64) @@ -44,7 +59,7 @@ runs: python3 ./.github/workflows/scripts/package-distribution.py \ --input package-macOS-ARM64/ \ --dest package/ \ - --version "${{ inputs.version-name }}" \ + --version "${{ steps.compute-version-name.outputs.version-name }}" \ --target "macos-arm64" - name: Package distribution (Windows-X64) @@ -53,7 +68,7 @@ runs: python3 ./.github/workflows/scripts/package-distribution.py \ --input package-Windows-X64/ \ --dest package/ \ - --version "${{ inputs.version-name }}" \ + --version "${{ steps.compute-version-name.outputs.version-name }}" \ --target "windows-x64" - name: Package Explorer @@ -63,7 +78,7 @@ runs: --input package-explorer/ \ --dest package/ \ --name "mithril-explorer" \ - --version "${{ inputs.version-name }}" + --version "${{ steps.compute-version-name.outputs.version-name }}" - name: Prepare crates versions table shell: bash @@ -141,6 +156,27 @@ runs: DOWNLOAD_URL_BASE: ${{ inputs.download-url-base }} run: ./.github/workflows/scripts/verify-distribution.sh + - name: Download a Docker image + shell: bash + run: | + if [[ "${{ inputs.tag }}" == "unstable" ]]; then + MITHRIL_IMAGE_ID="main-${{ steps.slug.outputs.sha8 }}" + else + MITHRIL_IMAGE_ID="${{ inputs.tag }}-${{ steps.slug.outputs.sha8 }}" + fi + + cat >> ./release-notes-addon.txt << EOF + + ## Download a Docker image + You can directly pull prebuilt Mithril Docker images: + + | Binary | Image name | URL | + | ------------------ | :----------------------------------: | :----------------------------------------------------------: | + | mithril-aggregator | mithril-aggregator:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-aggregator:$MITHRIL_IMAGE_ID | + | mithril-signer | mithril-signer:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-signer:$MITHRIL_IMAGE_ID | + | mithril-client | mithril-client:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID | + EOF + - name: List packaged assets shell: bash run: ls -al ./package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45c317c52c6..8811607f1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -688,7 +688,7 @@ jobs: - name: Prepare distribution package uses: ./.github/workflows/actions/prepare-distribution with: - version-name: unstable-${{ steps.slug.outputs.sha8 }} + tag: unstable download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/unstable gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }} compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "⛔", "testing-preview": "✔" }' diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d1cae582b83..831bbed7873 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -88,7 +88,7 @@ jobs: - name: Prepare distribution package uses: ./.github/workflows/actions/prepare-distribution with: - version-name: ${{ github.ref_name }} + tag: ${{ github.ref_name }} download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }} gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }} compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "✔", "testing-preview": "⛔" }' From 757fd5e9616002102d8c1131787a64ee3257bcd0 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:26:58 +0200 Subject: [PATCH 3/3] ci: add `Download a binary asset` section in the release note --- .../actions/prepare-distribution/action.yml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/actions/prepare-distribution/action.yml b/.github/workflows/actions/prepare-distribution/action.yml index 7b4498b8ac9..b4040b87233 100644 --- a/.github/workflows/actions/prepare-distribution/action.yml +++ b/.github/workflows/actions/prepare-distribution/action.yml @@ -142,6 +142,27 @@ runs: \`git tag -d unstable && git fetch origin tag unstable\` EOF + - name: Download a binary asset + shell: bash + run: | + cat >> ./release-notes-addon.txt << EOF + + ## Download a binary asset + To simplify the installation and updating of Mithril binaries, we have created a one line installer that downloads and installs the Mithril binaries for you. + This installer is available for Linux and macOS and supports the Mithril signer, Mithril aggregator, and Mithril client CLI. + + Use the following commands to install the Mithril nodes: + + - Download the **Mithril signer** in the current directory: + \`curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-signer -d ${{ inputs.tag }} -p $(pwd)\` + + - Download the **Mithril client CLI** in the current directory: + \`curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-client -d ${{ inputs.tag }} -p $(pwd)\` + + - Download the **Mithril aggregator** in the current directory: + \`curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-aggregator -d ${{ inputs.tag }} -p $(pwd)\` + EOF + - name: Create and sign sha256 checksum shell: bash env: