Skip to content

Commit 58c4245

Browse files
committed
ci: add a Download a Docker image section
1 parent 7c8176a commit 58c4245

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

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

Lines changed: 37 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,26 @@ inputs:
2020
runs:
2121
using: "composite"
2222
steps:
23+
- name: Get short SHA
24+
id: slug
25+
run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
26+
27+
- name: Compute version name
28+
id: compute-version-name
29+
run: |
30+
if [[ "${{ inputs.tag }}" == "unstable" ]]; then
31+
echo "version-name=unstable-${{ steps.slug.outputs.sha8 }}" >> $GITHUB_OUTPUT
32+
else
33+
echo "version-name=${{ inputs.tag }}" >> $GITHUB_OUTPUT
34+
fi
35+
2336
- name: Package distribution (Linux-X64)
2437
shell: bash
2538
run: |
2639
python3 ./.github/workflows/scripts/package-distribution.py \
2740
--input package-Linux-X64/ \
2841
--dest package/ \
29-
--version "${{ inputs.version-name }}" \
42+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
3043
--target "linux-x64"
3144
3245
- name: Package distribution (Linux-ARM64)
@@ -35,7 +48,7 @@ runs:
3548
python3 ./.github/workflows/scripts/package-distribution.py \
3649
--input package-Linux-ARM64/ \
3750
--dest package/ \
38-
--version "${{ inputs.version-name }}" \
51+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
3952
--target "linux-arm64"
4053
4154
- name: Package distribution (macOS-ARM64)
@@ -44,7 +57,7 @@ runs:
4457
python3 ./.github/workflows/scripts/package-distribution.py \
4558
--input package-macOS-ARM64/ \
4659
--dest package/ \
47-
--version "${{ inputs.version-name }}" \
60+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
4861
--target "macos-arm64"
4962
5063
- name: Package distribution (Windows-X64)
@@ -53,7 +66,7 @@ runs:
5366
python3 ./.github/workflows/scripts/package-distribution.py \
5467
--input package-Windows-X64/ \
5568
--dest package/ \
56-
--version "${{ inputs.version-name }}" \
69+
--version "${{ steps.compute-version-name.outputs.version-name }}" \
5770
--target "windows-x64"
5871
5972
- name: Package Explorer
@@ -63,7 +76,7 @@ runs:
6376
--input package-explorer/ \
6477
--dest package/ \
6578
--name "mithril-explorer" \
66-
--version "${{ inputs.version-name }}"
79+
--version "${{ steps.compute-version-name.outputs.version-name }}"
6780
6881
- name: Prepare crates versions table
6982
shell: bash
@@ -165,6 +178,23 @@ runs:
165178
DOWNLOAD_URL_BASE: ${{ inputs.download-url-base }}
166179
run: ./.github/workflows/scripts/verify-distribution.sh
167180

181+
- name: Download a Docker image
182+
shell: bash
183+
run: |
184+
MITHRIL_IMAGE_ID="${{ steps.compute-version-name.outputs.version-name }}"
185+
186+
cat >> ./release-notes-addon.txt << EOF
187+
188+
## Download a Docker image
189+
You can directly pull prebuilt Mithril Docker images:
190+
191+
| Binary | Image name | URL |
192+
| ------------------ | :----------------------------------: | :----------------------------------------------------------: |
193+
| mithril-aggregator | mithril-aggregator:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-aggregator:$MITHRIL_IMAGE_ID |
194+
| mithril-signer | mithril-signer:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-signer:$MITHRIL_IMAGE_ID |
195+
| mithril-client | mithril-client:$MITHRIL_IMAGE_ID | ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID |
196+
EOF
197+
168198
- name: List packaged assets
169199
shell: bash
170200
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)