Skip to content
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

Fix CD release #184

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Fix CD release #184

merged 3 commits into from
Jan 22, 2025

Conversation

atteggiani
Copy link
Collaborator

  • Added step to re-format paths in the CD.yml for the correct release
  • Removed conversion in the uibcdf/action-build-and-upload-conda-packages step, because um2nc can only be installed on platforms where mo_pack is also present.

blimlim
blimlim previously approved these changes Jan 22, 2025
Copy link
Collaborator

@blimlim blimlim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @atteggiani!

Copy link
Collaborator

@jo-basevi jo-basevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review! Just have a couple small questions

@atteggiani
Copy link
Collaborator Author

I'm just looking at the GitHub context functions and there is this join function that (based on my understanding of it), could be used in the Create Release step (and so we could get rid of the Re-format output paths step) and would look like:

 - name: Create Release
        uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 #v2.0.8
        with:
            tag_name: ${{ github.ref_name }}
            name: ${{needs.get-package-name.outputs.package-name}} ${{ github.ref_name }}
            generate_release_notes: true
            fail_on_unmatched_files: true
-           files: ${{steps.build-and-upload.outputs.paths}}
+           files: ${{ join(steps.build-and-upload.outputs.paths, '\n') }}

But I am not completely sure as I have never used join.
What do you think @jo-basevi?

@jo-basevi
Copy link
Collaborator

I'm just looking at the GitHub context functions and there is this join function that (based on my understanding of it), could be used in the Create Release step (and so we could get rid of the Re-format output paths step)

Join would be a really neat solution! I tried running a couple tests with it as I haven't used it either. I tested having a steps.path.outputs.space_separated_string which was set to "path1 path2 path3", but "${{ join(steps.paths.outputs.space_separated_string, '\n') }}" would leave it unchanged. I only had much luck with getting a string separated with \n when:

  • using outputs from multiples steps with * - ${{ join(steps.*.outputs.list, '\n') }}
  • using fromJson with a formatted json string - "${{ join(fromJson(steps.paths.outputs.list), '\n') }}" where steps.paths.outputs.list was '["path1", "path2", "path3"]'.

But the docs say the input can be string - so maybe something was wrong with my test setup..

@jo-basevi
Copy link
Collaborator

@CodeGat Do you know much on how to use `join()?

@CodeGat
Copy link
Member

CodeGat commented Jan 22, 2025

I haven't had any luck with it being a string, either. I confirmed @jo-basevi s tests, as well. I suspect that the docs are wrong, or mean "JSON array as string", rather than space-separated string. I think the solutions are either doing it as @jo-basevi mentioned above, or doing it in bash via tr ' ' '\n' <<< "${{ steps.build-and-upload.outputs.paths }}"...

@atteggiani
Copy link
Collaborator Author

@jo-basevi @CodeGat
Thank you for your tests.

Alright, I removed the commit where I updated that part of the code.

Copy link
Collaborator

@jo-basevi jo-basevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @atteggiani, looks good to me

@atteggiani atteggiani merged commit b44e549 into main Jan 22, 2025
5 checks passed
@atteggiani atteggiani deleted the davide/fix_CD branch January 22, 2025 22:52
@atteggiani
Copy link
Collaborator Author

Thanks @jo-basevi, @blimlim and @CodeGat.
Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants