Skip to content

Commit

Permalink
Merge pull request #2170 from input-output-hk/djo/package-explorer-in…
Browse files Browse the repository at this point in the history
…-releases

Fix explorer packaging in releases
  • Loading branch information
Alenar authored Dec 12, 2024
2 parents 404212a + a5188ec commit 572f00e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/actions/prepare-distribution/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ runs:
--version "${{ inputs.version-name }}" \
--target "windows-x64"
- name: Package Explorer
shell: bash
run: |
python3 ./.github/workflows/scripts/package-distribution.py \
--input package-explorer/ \
--dest package/ \
--name "mithril-explorer" \
--version "${{ inputs.version-name }}"
- name: Prepare crates versions table
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: explorer-build
path: ./package
path: ./package-explorer

- name: Prepare distribution package
uses: ./.github/workflows/actions/prepare-distribution
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ jobs:
workflow: ci.yml
workflow_conclusion: success

- name: Download built artifacts (Explorer)
uses: dawidd6/action-download-artifact@v6
with:
name: explorer-build
path: ./package-explorer
commit: ${{ github.sha }}
workflow: ci.yml
workflow_conclusion: success

- name: Append VERSION file
run: |
echo ${{ github.ref_name }} >> ./package/VERSION
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/scripts/package-distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def check_archive(archive_path, original_input_dir):


def main(args):
archive_path = build_archive(
args.input, args.dest, archive_basename=f"mithril-{args.version}-{args.target}")
archive_basename = f"{args.name}-{args.version}" if args.target is None else f"{args.name}-{args.version}-{args.target}"

archive_path = build_archive(args.input, args.dest, archive_basename)
check_archive(archive_path, args.input)


Expand All @@ -58,13 +59,15 @@ def main(args):
prog="Mithril distribution packager",
description="Package the files in the given '--input' dir in a .tar.gz (linux, macOs) or .zip (windows)."
)
parser.add_argument("--name", help="name of the distribution to package, prefix of the archive name",
default="mithril")
parser.add_argument("--input", type=dir_path,
help="input folder which content will be archived", required=True)
parser.add_argument("--dest", type=dir_path, help="destination folder for the archive, default to current folder",
default="./")
parser.add_argument(
"--version", help="version of the distribution to package", required=True)
parser.add_argument(
"--target", help="target os & architecture of the package", required=True)
"--target", help="target os & architecture of the package", required=False)

main(parser.parse_args())

0 comments on commit 572f00e

Please sign in to comment.