Skip to content
47 changes: 33 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI (uv)

on:
push:
branches: ["main", "master"]
branches: ["main"]
pull_request:
branches: ["*"]
release:
Expand Down Expand Up @@ -138,11 +138,31 @@ jobs:
- name: Run GitLab integration tests
if: ${{ env.GITLAB_API_TOKEN != '' }}
run: uv run pytest --run-integration-gitlab -m "integration_gitlab" tests/test_gitlab_integration.py




test-zenodo-connection:
name: Test Zenodo connection
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/escape-ossr/eossr:v2.2.0
steps:

- name: Checkout repository
uses: actions/checkout@v7

- name: Convert CodeMeta to Zenodo metadata
uses: escape2020/codemeta2zenodo@v1.3.0
with:
overwrite: true

- name: Verify Zenodo token before integration tests
run: |
eossr-check-connection-zenodo \
--token "${{ secrets.ZENODO_ACCESS_TOKEN }}" \
--project_dir .



docs:
name: Docs (Sphinx)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -197,27 +217,26 @@ jobs:
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
run: # need to setup a trusted publisher in Pypi (but avoid passing pypi tokens and password to Github secrets).
uv publish

publish-zenodo:
# name: Publish to Zenodo
if: github.event_name == 'release'
needs: [lint, test]
needs: [lint, test, test-zenodo-connection]
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/escape-ossr/eossr:v2.2.0
steps:
- uses: actions/checkout@v7
- name: Setup uv environment
uses: ./.github/actions/setup-uv
with:
dependency-group: dev
- name: Convert CodeMeta to Zenodo metadata
run: uvx --from eossr eossr-codemeta2zenodo -i codemeta.json --overwrite

uses: escape2020/codemeta2zenodo@v1.3.0
with:
overwrite: true
- name: Upload and Publish to Zenodo via eossr
run: |
uvx --from eossr eossr-upload-repository \
eossr-upload-repository \
--token "${{ secrets.ZENODO_ACCESS_TOKEN }}" \
--input-dir . \
--archive-name $CI_PROJECT_NAME.zip \
--record_id "${{ secrets.ZENODO_DEPOSITION_ID }}"
33 changes: 33 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: sw-metadata-bot
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Tom
family-names: François
email: tom.francois@lapp.in2p3.fr
orcid: 'https://orcid.org/0000-0001-5226-3089'
affiliation: 'Univ. Savoie Mont-Blanc, CNRS, LAPP'
identifiers:
- type: doi
value: 10.5281/zenodo.19468976
- type: swh
value: 'swh:1:dir:9f3d474c040158cc675e8db135767e0d2d3fba7b'
repository-code: 'https://github.com/SoftwareUnderstanding/sw-metadata-bot'
url: 'https://w3id.org/codemetasoft/'
abstract: >-
A repository to keep the code of the RSMetaCheck bot for
pushing issues with existing repository metadata
keywords:
- metadata
- codemeta
- bot
- software
license: MIT
version: 0.5.1
date-released: '2026-07-02'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# sw-metadata-bot

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19468976.svg)](https://doi.org/10.5281/zenodo.19468976)
[![SWH](https://archive.softwareheritage.org/badge/swh:1:dir:9f3d474c040158cc675e8db135767e0d2d3fba7b/)](https://archive.softwareheritage.org/swh:1:dir:9f3d474c040158cc675e8db135767e0d2d3fba7b;origin=https://github.com/SoftwareUnderstanding/sw-metadata-bot;visit=swh:1:snp:03da984544982fdf5aa1f556012b917250f1e4c3;anchor=swh:1:rev:fc64150edf2e35f045cf3858d81b00ca6e7f6e68)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-0.5.1-blue.svg)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases)
[![Python 3.11--3.12](https://img.shields.io/badge/python-3.11--3.12-blue.svg)](https://www.python.org/downloads/)
Expand Down
6 changes: 6 additions & 0 deletions update_version_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## Currently handles:
# - codemeta.json: updates the version and dateModified fields
# - README.md: updates the version badge
# - Citation.cff: updates the version field

NEW_VERSION=$(uv version | cut -d' ' -f2)
TODAY=$(date +%Y-%m-%d)
Expand All @@ -33,6 +34,11 @@ with open('codemeta.json', 'w') as f:
# Update README.md
sed -i "s|badge/version-[^)]*-|badge/version-$NEW_VERSION-|g" README.md

# update the CITATION.cff file

sed -i "s/^version: .*/version: $NEW_VERSION/" CITATION.cff
sed -i "s/^date-released: .*/date-released: $TODAY/" CITATION.cff

# update the uv.lock file
uv sync

Expand Down
Loading