Skip to content

Fix explorer packaging in releases #2170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())
Loading