This commit is contained in:
Dennis Klein 2023-11-30 15:47:11 +00:00 committed by GitHub
commit 2e850d32fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 23 deletions

57
.github/workflows/codemeta.yaml vendored Normal file
View File

@ -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
- 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
publish:
needs: validate
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

View File

@ -1,21 +0,0 @@
name: validate codemeta
on:
push:
paths:
- codemeta.json
- .github/workflows/codemeta_validate.yaml
pull_request:
paths:
- codemeta.json
- .github/workflows/codemeta_validate.yaml
jobs:
build:
runs-on: ubuntu-latest
container:
image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v1.0
steps:
- uses: actions/checkout@v3
- name: validate codemeta
run: eossr-metadata-validator codemeta.json

View File

@ -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}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM USES_TERMINAL)
################################################################################

View File

@ -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}'
manipulator.save(filename)
if __name__ == '__main__':

View File

@ -6,7 +6,7 @@ LABEL org.opencontainers.image.description "FairMQ development environment"
RUN dnf -y update
# https://git.gsi.de/SDE/packages/builder
RUN dnf -y install https://alfa-ci.gsi.de/packages/rpm/fedora-$VERSION-x86_64/fairsoft-release-dev.rpm
RUN dnf -y install clang cli11-devel ninja-build 'dnf-command(builddep)' libasan liblsan libtsan libubsan clang-tools-extra
RUN dnf -y install clang cli11-devel ninja-build 'dnf-command(builddep)' libasan liblsan libtsan libubsan clang-tools-extra python3
RUN dnf -y builddep fairmq
RUN dnf -y clean all