diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 562f509..7a76ae7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,34 @@ on: - "v*" jobs: + update-citation: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.BOT_TOKEN }} + + - name: Update CITATION.cff + run: | + VERSION="${GITHUB_REF_NAME}" + DATE=$(date +%Y-%m-%d) + yq -i ".version = \"$VERSION\"" CITATION.cff + yq -i ".[\"date-released\"] = \"$DATE\"" CITATION.cff + yq -i ".title = \"John-Ragland/pygenray: $VERSION\"" CITATION.cff + + - name: Commit and push + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add CITATION.cff + git diff --staged --quiet || git commit -m "chore: update CITATION.cff for ${GITHUB_REF_NAME}" + git push origin main + build: + needs: update-citation runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/CITATION.cff b/CITATION.cff index 0148b2c..dc2026b 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,4 +8,5 @@ authors: title: "John-Ragland/pygenray: Initial Release" version: v0.0.1 date-released: 2025-07-01 +doi: 10.5281/zenodo.15783848 url: "https://github.com/John-Ragland/pygenray"