Skip to content

Commit

Permalink
Merge pull request #9 from nsls2-conda-envs/2023-3.0
Browse files Browse the repository at this point in the history
Upload 2023-3.0 envs to Zenodo
  • Loading branch information
mrakitin committed Sep 14, 2023
2 parents 67c400a + f29d48d commit f1c6a8e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ jobs:
set -vxeuo pipefail
#
# Artifacts from https://github.com/nsls2-conda-envs/nsls2-collection/actions/runs/5416168747
# Artifacts from https://github.com/nsls2-conda-envs/nsls2-collection/actions/runs/6176876013
#
# https://github.com/nsls2-conda-envs/nsls2-collection/suites/13962286137/artifacts/778232809
bash ${GITHUB_WORKSPACE}/download-artifacts.sh nsls2-collection 778232809 2023-2.1-py310
# https://github.com/nsls2-conda-envs/nsls2-collection/suites/16137131189/artifacts/921432739
bash ${GITHUB_WORKSPACE}/download-artifacts.sh nsls2-collection 921432739 2023-3.0-py310
#
# Artifacts from https://github.com/nsls2-conda-envs/nsls2-collection-tiled/actions/runs/5416167608
# Artifacts from https://github.com/nsls2-conda-envs/nsls2-collection-tiled/actions/runs/6176873945
#
# https://github.com/nsls2-conda-envs/nsls2-collection-tiled/suites/13962282224/artifacts/778231137
bash ${GITHUB_WORKSPACE}/download-artifacts.sh nsls2-collection-tiled 778231137 2023-2.1-py310-tiled
# https://github.com/nsls2-conda-envs/nsls2-collection-tiled/suites/16137123471/artifacts/921430178
bash ${GITHUB_WORKSPACE}/download-artifacts.sh nsls2-collection-tiled 921430178 2023-3.0-py310-tiled
- name: Upload artifacts to Zenodo
run: |
Expand Down
24 changes: 18 additions & 6 deletions test-upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,35 @@ def create_new_version(

notes_urls = [
# non-tiled
"https://github.com/nsls2-conda-envs/nsls2-collection/pull/22",
"https://github.com/nsls2-conda-envs/nsls2-collection/actions/runs/5416168747",
"https://github.com/nsls2-conda-envs/nsls2-collection/pull/23",
"https://github.com/nsls2-conda-envs/nsls2-collection/actions/runs/6176876013",
# need this empty line to enforce line break on Zenodo:
"",
# tiled
"https://github.com/nsls2-conda-envs/nsls2-collection-tiled/pull/17",
"https://github.com/nsls2-conda-envs/nsls2-collection-tiled/actions/runs/5416167608",
"https://github.com/nsls2-conda-envs/nsls2-collection-tiled/pull/19",
"https://github.com/nsls2-conda-envs/nsls2-collection-tiled/actions/runs/6176873945",
]
notes_urls_strs = "<br>\n".join([f'<a href="{url}">{url}</a>'
if url else ""
for url in notes_urls])

unpack_instructions = """
Unpacking instructions:
<br>
<pre>
mkdir -p ~/conda_envs/&lt;env-name&gt;
cd ~/conda_envs/&lt;env-name&gt;
wget &lt;url-to&gt;/&lt;env-name&gt;.tar.gz
tar -xvf &lt;env-name&gt;.tar.gz
conda activate $PWD
conda-unpack
</pre>
"""
data = {
"metadata": {
"version": version,
"title": f"NSLS-II collection conda environment {version} with Python 3.10",
"description": "NSLS-II collection environment deployed to the experimental floor.",
"description": f"NSLS-II collection environment deployed to the experimental floor.<br><br>{unpack_instructions}",
"upload_type": "software",
"publication_date": datetime.datetime.now().strftime("%Y-%m-%d"),
"prereserve_doi": True,
Expand Down Expand Up @@ -162,7 +174,7 @@ def update_deposition_with_files(conceptrecid=None, files=None, token=None):
if __name__ == "__main__":

conceptrecid = "4057062"
version = "2023-2.1"
version = "2023-3.0"
token = os.environ["ZENODO_TOKEN"]

resp = create_new_version(
Expand Down

0 comments on commit f1c6a8e

Please sign in to comment.