Skip to content

Commit 2ee7ea4

Browse files
committed
ci: add a Download a Docker image section
1 parent 101a9bc commit 2ee7ea4

File tree

3 files changed

+45
-9
lines changed

3 files changed

+45
-9
lines changed

.github/workflows/actions/prepare-distribution/action.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description: |
55
The artifacts for all supported environments must have been downloaded
66
in "package-{EnvName}-x64" subfolders before calling this action.
77
inputs:
8-
version-name:
9-
description: Name of the version to package
8+
tag:
9+
description: The tag to use for the distribution
1010
required: true
1111
download-url-base:
1212
description: Base url where the released distribution will be downloadable
@@ -20,13 +20,28 @@ inputs:
2020
runs:
2121
using: "composite"
2222
steps:
23+
- name: Get short SHA
24+
id: slug
25+
shell: bash
26+
run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
27+
28+
- name: Compute version name
29+
id: compute-version-name
30+
shell: bash
31+
run: |
32+
if [[ "${{ inputs.tag }}" == "unstable" ]]; then
33+
echo "version-name=unstable-${{ steps.slug.outputs.sha8 }}" >> $GITHUB_OUTPUT
34+
else
35+
echo "version-name=${{ inputs.tag }}" >> $GITHUB_OUTPUT
36+
fi
37+
2338
- name: Package distribution (Linux-X64)
2439
shell: bash
2540
run: |
2641
python3 ./.github/workflows/scripts/package-distribution.py \
2742
--input package-Linux-X64/ \
2843
--dest package/ \
29-
--version "${{ inputs.version-name }}" \
44+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
3045
--target "linux-x64"
3146
3247
- name: Package distribution (Linux-ARM64)
@@ -35,7 +50,7 @@ runs:
3550
python3 ./.github/workflows/scripts/package-distribution.py \
3651
--input package-Linux-ARM64/ \
3752
--dest package/ \
38-
--version "${{ inputs.version-name }}" \
53+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
3954
--target "linux-arm64"
4055
4156
- name: Package distribution (macOS-ARM64)
@@ -44,7 +59,7 @@ runs:
4459
python3 ./.github/workflows/scripts/package-distribution.py \
4560
--input package-macOS-ARM64/ \
4661
--dest package/ \
47-
--version "${{ inputs.version-name }}" \
62+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
4863
--target "macos-arm64"
4964
5065
- name: Package distribution (Windows-X64)
@@ -53,7 +68,7 @@ runs:
5368
python3 ./.github/workflows/scripts/package-distribution.py \
5469
--input package-Windows-X64/ \
5570
--dest package/ \
56-
--version "${{ inputs.version-name }}" \
71+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
5772
--target "windows-x64"
5873
5974
- name: Package Explorer
@@ -63,7 +78,7 @@ runs:
6378
--input package-explorer/ \
6479
--dest package/ \
6580
--name "mithril-explorer" \
66-
--version "${{ inputs.version-name }}"
81+
--version "${{ steps.compute-version-name.outputs.version-name }}"
6782
6883
- name: Prepare crates versions table
6984
shell: bash
@@ -141,6 +156,27 @@ runs:
141156
DOWNLOAD_URL_BASE: ${{ inputs.download-url-base }}
142157
run: ./.github/workflows/scripts/verify-distribution.sh
143158

159+
- name: Download a Docker image
160+
shell: bash
161+
run: |
162+
if [[ "${{ inputs.tag }}" == "unstable" ]]; then
163+
MITHRIL_IMAGE_ID="main-${{ steps.slug.outputs.sha8 }}"
164+
else
165+
MITHRIL_IMAGE_ID="${{ inputs.tag }}-${{ steps.slug.outputs.sha8 }}"
166+
fi
167+
168+
cat >> ./release-notes-addon.txt << EOF
169+
170+
## Download a Docker image
171+
You can directly pull prebuilt Mithril Docker images:
172+
173+
| Binary | Image name | URL |
174+
| ------------------ | :----------------------------------: | :----------------------------------------------------------: |
175+
| mithril-aggregator | mithril-aggregator:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-aggregator:$MITHRIL_IMAGE_ID |
176+
| mithril-signer | mithril-signer:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-signer:$MITHRIL_IMAGE_ID |
177+
| mithril-client | mithril-client:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID |
178+
EOF
179+
144180
- name: List packaged assets
145181
shell: bash
146182
run: ls -al ./package

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ jobs:
688688
- name: Prepare distribution package
689689
uses: ./.github/workflows/actions/prepare-distribution
690690
with:
691-
version-name: unstable-${{ steps.slug.outputs.sha8 }}
691+
tag: unstable
692692
download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/unstable
693693
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
694694
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "⛔", "testing-preview": "✔" }'

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- name: Prepare distribution package
8989
uses: ./.github/workflows/actions/prepare-distribution
9090
with:
91-
version-name: ${{ github.ref_name }}
91+
tag: ${{ github.ref_name }}
9292
download-url-base: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}
9393
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
9494
compatibility-table: '{ "release-mainnet": "⛔", "release-preprod": "⛔", "pre-release-preview": "✔", "testing-preview": "⛔" }'

0 commit comments

Comments
 (0)