Skip to content

Commit 54defd6

Browse files
authored
Merge pull request #466 from CCPBioSim/meta-data
Add web metadata for CodeEntropy project
2 parents 1a10108 + d898d34 commit 54defd6

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

‎.github/web-meta.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
shortdesc: "This code is a complete and generally applicable set of tools for computing entropy of macromolecular systems from the forces sampled in a MD simulation."
2+
longdesc: "CodeEntropy is a Python package for computing the configurational entropy of macromolecular systems using forces sampled from molecular dynamics (MD) simulations. It implements the multiscale cell correlation method to provide accurate and efficient entropy estimates, supporting a wide range of applications in molecular simulation and statistical mechanics."
3+
category: "scientific"
4+
image: "codeentropy-logo-chip-dark.svg"
5+
pypi: true
6+
conda: true
7+
ghcr: false

‎.github/workflows/release.yaml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,68 @@ jobs:
155155
--data-urlencode "topic=software releases" \
156156
--data-urlencode "content=${CONTENT}"
157157
158+
- name: checkout
159+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
160+
161+
- name: Build dispatch payload
162+
id: payload
163+
shell: bash
164+
env:
165+
NAME: ${{ github.event.repository.name }}
166+
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
167+
VERSION: ${{ github.event.inputs.version }}
168+
META_FILE: .github/web-meta.yaml
169+
CFF_FILE: CITATION.cff
170+
run: |
171+
for f in "$META_FILE" "$CFF_FILE"; do
172+
if [ ! -f "$f" ]; then
173+
echo "::error::$f not found in $(pwd)"
174+
ls -la . .github
175+
exit 1
176+
fi
177+
done
178+
179+
# Constructed URLs (Read the Docs slugs are lowercase)
180+
github_url="$REPO_URL"
181+
docs_url="https://${NAME,,}.readthedocs.io/"
182+
183+
# Metadata from web-meta.yaml
184+
meta=$(yq -o=json '.' "$META_FILE")
185+
186+
# Authors from CITATION.cff -> { "Full Name": "orcid url" }
187+
authors=$(yq -o=json '.authors' "$CFF_FILE" | jq -c '
188+
map({
189+
key: (
190+
if .name then .name
191+
else ([."given-names", ."family-names"] | map(select(. != null)) | join(" "))
192+
end
193+
),
194+
value: (.orcid // "")
195+
}) | from_entries')
196+
197+
payload=$(jq -nc \
198+
--arg name "$NAME" \
199+
--arg github "$github_url" \
200+
--arg docs "$docs_url" \
201+
--arg version "$VERSION" \
202+
--argjson meta "$meta" \
203+
--argjson authors "$authors" \
204+
'{
205+
name: $name,
206+
meta: ({github: $github, docs: $docs} + $meta + {version: $version, authors: $authors})
207+
}')
208+
209+
echo "payload: $payload"
210+
echo "json=$payload" >> "$GITHUB_OUTPUT"
211+
212+
- name: Post version to website metadata repo
213+
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
214+
with:
215+
token: ${{ secrets.BUILD_TOKEN }}
216+
repository: ccpbiosim/ccpbiosim.github.io
217+
event-type: software
218+
client-payload: ${{ steps.payload.outputs.json }}
219+
158220
pypi:
159221
name: make pypi release
160222
needs: [tag, release]

0 commit comments

Comments
 (0)