Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,51 +134,51 @@ jobs:
with:
generate_release_notes: true

publish-zenodo:
name: Publish Zenodo release
needs: publish-github-release
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: read
env:
ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install release tooling
run: |
python -m pip install --upgrade pip
python -m pip install PyYAML
shell: bash

- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: dist-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}
path: dist

- name: Generate release citation metadata
run: |
python tools/release/sync_citation.py \
--tag "${GITHUB_REF_NAME}" \
--output "${RUNNER_TEMP}/CITATION.cff"
shell: bash

- name: Check tree stayed clean
run: |
git diff --quiet || (git status --short && git diff && exit 1)
shell: bash

- name: Publish to Zenodo
run: |
python tools/release/publish_zenodo.py \
--dist-dir dist \
--citation-file "${RUNNER_TEMP}/CITATION.cff"
shell: bash
# publish-zenodo:
# name: Publish Zenodo release
# needs: publish-github-release
# runs-on: ubuntu-latest
# if: github.event_name == 'push'
# permissions:
# contents: read
# env:
# ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
# steps:
# - uses: actions/checkout@v6
# with:
# fetch-depth: 0
#
# - uses: actions/setup-python@v6
# with:
# python-version: "3.12"
#
# - name: Install release tooling
# run: |
# python -m pip install --upgrade pip
# python -m pip install PyYAML
# shell: bash
#
# - name: Download artifacts
# uses: actions/download-artifact@v8
# with:
# name: dist-${{ github.sha }}-${{ github.run_id }}-${{ github.run_number }}
# path: dist
#
# - name: Generate release citation metadata
# run: |
# python tools/release/sync_citation.py \
# --tag "${GITHUB_REF_NAME}" \
# --output "${RUNNER_TEMP}/CITATION.cff"
# shell: bash
#
# - name: Check tree stayed clean
# run: |
# git diff --quiet || (git status --short && git diff && exit 1)
# shell: bash
#
# - name: Publish to Zenodo
# run: |
# python tools/release/publish_zenodo.py \
# --dist-dir dist \
# --citation-file "${RUNNER_TEMP}/CITATION.cff"
# shell: bash
10 changes: 2 additions & 8 deletions ultraplot/tests/test_release_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,13 @@ def test_readme_citation_section_uses_repository_metadata():
assert "@software{" not in text


def test_publish_workflow_creates_github_release_and_pushes_to_zenodo():
def test_publish_workflow_creates_github_release():
"""
Release tags should sync citation metadata, create a GitHub release, and
publish the same dist to Zenodo.
Release tags should sync citation metadata and create a GitHub release.
"""
text = PUBLISH_WORKFLOW.read_text(encoding="utf-8")
assert 'tags: ["v*"]' in text
assert "tools/release/sync_citation.py" in text
assert "--tag" in text
assert "--output" in text
assert "softprops/action-gh-release@v2" in text
assert "publish-zenodo:" in text
assert "ZENODO_ACCESS_TOKEN" in text
assert "tools/release/publish_zenodo.py" in text
assert "--dist-dir dist" in text
assert '--citation-file "${RUNNER_TEMP}/CITATION.cff"' in text
Loading