diff --git a/.github/web-meta.yaml b/.github/web-meta.yaml new file mode 100644 index 00000000..2f2ebf06 --- /dev/null +++ b/.github/web-meta.yaml @@ -0,0 +1,7 @@ +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." +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." +category: "scientific" +image: "codeentropy-logo-chip-dark.svg" +pypi: true +conda: true +ghcr: false diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 04be2415..72c545a8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -155,6 +155,68 @@ jobs: --data-urlencode "topic=software releases" \ --data-urlencode "content=${CONTENT}" + - name: checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Build dispatch payload + id: payload + shell: bash + env: + NAME: ${{ github.event.repository.name }} + REPO_URL: ${{ github.server_url }}/${{ github.repository }} + VERSION: ${{ github.event.inputs.version }} + META_FILE: .github/web-meta.yaml + CFF_FILE: CITATION.cff + run: | + for f in "$META_FILE" "$CFF_FILE"; do + if [ ! -f "$f" ]; then + echo "::error::$f not found in $(pwd)" + ls -la . .github + exit 1 + fi + done + + # Constructed URLs (Read the Docs slugs are lowercase) + github_url="$REPO_URL" + docs_url="https://${NAME,,}.readthedocs.io/" + + # Metadata from web-meta.yaml + meta=$(yq -o=json '.' "$META_FILE") + + # Authors from CITATION.cff -> { "Full Name": "orcid url" } + authors=$(yq -o=json '.authors' "$CFF_FILE" | jq -c ' + map({ + key: ( + if .name then .name + else ([."given-names", ."family-names"] | map(select(. != null)) | join(" ")) + end + ), + value: (.orcid // "") + }) | from_entries') + + payload=$(jq -nc \ + --arg name "$NAME" \ + --arg github "$github_url" \ + --arg docs "$docs_url" \ + --arg version "$VERSION" \ + --argjson meta "$meta" \ + --argjson authors "$authors" \ + '{ + name: $name, + meta: ({github: $github, docs: $docs} + $meta + {version: $version, authors: $authors}) + }') + + echo "payload: $payload" + echo "json=$payload" >> "$GITHUB_OUTPUT" + + - name: Post version to website metadata repo + uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 + with: + token: ${{ secrets.BUILD_TOKEN }} + repository: ccpbiosim/ccpbiosim.github.io + event-type: software + client-payload: ${{ steps.payload.outputs.json }} + pypi: name: make pypi release needs: [tag, release]