Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
options: --privileged
env:
IMAGE_NAME: bot
IMAGE_VERSION: '1.4.0'
IMAGE_VERSION: '1.4.1'

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion images/bot/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = bioconda-bot
version = 0.0.5
version = 0.0.6

[options]
python_requires = >=3.8
Expand Down
27 changes: 17 additions & 10 deletions images/bot/src/bioconda_bot/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,29 @@ async def make_artifact_comment(session: ClientSession, pr: int, sha: str) -> No
imageHeader = "***\n\nDocker image(s) built:\n\n"
imageHeader += "Package | Tag | CI | Install with `docker`\n"
imageHeader += "---------|---------|-----|---------\n"

for [ci_platform, artifacts] in artifactDict.items():
for URL, artifact in artifacts:
if artifact.endswith(".tar.gz"):
image_name = artifact.split("/").pop()[: -len(".tar.gz")]
comment += imageHeader
imageHeader = "" # only add the header for the first image
if ':' in image_name:
package_name, tag = image_name.split(':', 1)
comment += imageHeader
imageHeader = "" # only add the header for the first image
if ci_platform == "azure":
comment += f"{package_name} | {tag} | Azure | "
comment += "<details><summary>show</summary>Images for Azure are in the LinuxArtifacts zip file above."
comment += f"`gzip -dc LinuxArtifacts/images/{image_name}.tar.gz \\| docker load`</details>\n"
elif ci_platform == "circleci":
comment += f"[{package_name}]({URL}) | {tag} | CircleCI | "
comment += f'<details><summary>show</summary>`curl -L "{URL}" \\| gzip -dc \\| docker load`</details>\n'
elif '---' in image_name:
package_name, tag = image_name.split('---', 1)
else:
continue
if ci_platform == "azure":
comment += f"{package_name} | {tag} | Azure | "
comment += "<details><summary>show</summary>Images for Azure are in the LinuxArtifacts zip file above."
comment += f"`gzip -dc LinuxArtifacts/images/{image_name}.tar.gz \\| docker load`</details>\n"
elif ci_platform == "circleci":
comment += f"[{package_name}]({URL}) | {tag} | CircleCI | "
comment += f'<details><summary>show</summary>`curl -L "{URL}" \\| gzip -dc \\| docker load`</details>\n'
elif ci_platform == "github-actions":
comment += f"{package_name} | {tag} | GitHub Actions | "
comment += "<details><summary>show</summary>Images are in the linux-64 zip file above."
comment += f"`gzip -dc images/{image_name}.tar.gz \\| docker load`</details>\n"
comment += "\n\n"

await send_comment(session, pr, comment)
Expand Down