-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generate codemeta.json
#483
base: dev
Are you sure you want to change the base?
Changes from all commits
5ec3bb9
a736ec7
64d1f41
ff8079b
42d51a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,57 @@ | ||||||
name: codemeta | ||||||
|
||||||
on: | ||||||
push: | ||||||
paths: | ||||||
- codemeta.json | ||||||
- .github/workflows/codemeta.yaml | ||||||
tags: | ||||||
- 'v*' | ||||||
pull_request: | ||||||
paths: | ||||||
- codemeta.json | ||||||
- .github/workflows/codemeta.yaml | ||||||
|
||||||
jobs: | ||||||
generate: | ||||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: ghcr.io/fairrootgroup/fairmq-dev/fedora-38:latest | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
with: | ||||||
fetch-depth: 150 | ||||||
fetch-tags: true | ||||||
- run: "git config --system --add safe.directory $GITHUB_WORKSPACE" | ||||||
- name: configure | ||||||
run: "cmake -G Ninja -S $GITHUB_WORKSPACE -B build" | ||||||
- name: generate codemeta.json | ||||||
run: cmake --build build --target codemeta | ||||||
- name: print result | ||||||
run: cat build/codemeta.json | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe?
Suggested change
|
||||||
- uses: actions/upload-artifact@v3 | ||||||
with: | ||||||
name: codemeta.json | ||||||
path: build/codemeta.json | ||||||
validate: | ||||||
needs: generate | ||||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v1.0 | ||||||
steps: | ||||||
- uses: actions/download-artifact@v3 | ||||||
with: | ||||||
name: codemeta.json | ||||||
- name: validate codemeta | ||||||
run: eossr-metadata-validator codemeta.json | ||||||
ChristianTackeGSI marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
publish: | ||||||
needs: validate | ||||||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, now you have the dep. Maybe do the moving of the validate step in this commit instead? |
||||||
runs-on: ubuntu-latest | ||||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||||||
steps: | ||||||
- uses: actions/download-artifact@v3 | ||||||
with: | ||||||
name: codemeta.json | ||||||
- uses: svenstaro/upload-release-action@v2 | ||||||
with: | ||||||
file: codemeta.json |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,11 @@ endif() | |
if(BUILD_TIDY_TOOL) | ||
add_subdirectory(fairmq/tidy) | ||
endif() | ||
|
||
add_custom_target(codemeta | ||
python3 ${CMAKE_SOURCE_DIR}/meta_update.py --outdir ${CMAKE_BINARY_DIR} --set-version ${PROJECT_VERSION} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya, was considering it, but there was so much noise with CMake's Python detection in the past that I am afraid it will introduce more maintenance work than hardcoding it - this target really does not need to be super platform independent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, got that! Please add a comment above it to that fact. Something like "meant for release management, not needed to be as portable". Have you looked into |
||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
VERBATIM USES_TERMINAL) | ||
################################################################################ | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ def main(): | |
parser = ArgumentParser(description='Update codemeta.json and ' | ||
'.zenodo.json') | ||
parser.add_argument('--set-version', dest='newversion') | ||
parser.add_argument('--outdir', dest='outdir') | ||
args = parser.parse_args() | ||
|
||
for manipulator in (CodeMetaManipulator(), ZenodoManipulator()): | ||
|
@@ -150,7 +151,10 @@ def main(): | |
if args.newversion is not None: | ||
manipulator.version(args.newversion) | ||
manipulator.update_authors() | ||
manipulator.save() | ||
filename = None | ||
if args.outdir is not None: | ||
filename = f'{args.outdir}/{manipulator.default_filename}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer a |
||
manipulator.save(filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the semantics (AND) compared to the "old" validate workflow. Please comment on this in the commit text body. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, ye, will revisit this. thought it was OR logic.