Skip to content

Commit c80a489

Browse files
author
Jon Palmer
committed
fix login in citation update
1 parent 1544a44 commit c80a489

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

.github/workflows/production-release.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ jobs:
5050
echo "exists=false" >> $GITHUB_OUTPUT
5151
fi
5252
53-
create-tag:
54-
name: Create tag if needed
53+
update-citation:
54+
name: Update CITATION.cff
5555
needs: validate-tag
5656
runs-on: ubuntu-latest
57-
if: needs.validate-tag.outputs.tag_exists == 'false' && github.event.inputs.create_tag == 'true'
5857

5958
steps:
6059
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0 # Fetch all history for tags
6162

62-
- name: Update CITATION.cff and create tag
63+
- name: Update CITATION.cff
6364
run: |
6465
# Get current date in YYYY-MM-DD format
6566
TODAY=$(date +"%Y-%m-%d")
@@ -92,23 +93,43 @@ jobs:
9293
if ! git diff --quiet CITATION.cff; then
9394
git add CITATION.cff
9495
git commit -m "Update CITATION.cff to version $VERSION [skip ci]"
96+
git push origin HEAD
97+
else
98+
echo "No changes to CITATION.cff"
9599
fi
96100
101+
create-tag:
102+
name: Create tag if needed
103+
needs: [validate-tag, update-citation]
104+
runs-on: ubuntu-latest
105+
if: needs.validate-tag.outputs.tag_exists == 'false' && github.event.inputs.create_tag == 'true'
106+
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
ref: main # Get the latest main branch with CITATION.cff updates
111+
112+
- name: Create and push tag
113+
run: |
114+
# Configure git
115+
git config user.name "github-actions[bot]"
116+
git config user.email "github-actions[bot]@users.noreply.github.com"
117+
97118
# Create and push tag
98119
git tag ${{ needs.validate-tag.outputs.tag }}
99-
git push origin HEAD
100120
git push origin ${{ needs.validate-tag.outputs.tag }}
101121
102122
build:
103123
name: Build distribution 📦
104-
needs: [validate-tag, create-tag]
105-
if: always() && needs.validate-tag.result == 'success' && (needs.create-tag.result == 'success' || needs.create-tag.result == 'skipped')
124+
needs: [validate-tag, update-citation, create-tag]
125+
if: always() && needs.validate-tag.result == 'success' && needs.update-citation.result == 'success' && (needs.create-tag.result == 'success' || needs.create-tag.result == 'skipped')
106126
runs-on: ubuntu-latest
107127

108128
steps:
109129
- uses: actions/checkout@v4
110130
with:
111-
ref: ${{ needs.validate-tag.outputs.tag }}
131+
# If tag exists, use it; otherwise use main branch with updated CITATION.cff
132+
ref: ${{ needs.validate-tag.outputs.tag_exists == 'true' && needs.validate-tag.outputs.tag || 'main' }}
112133

113134
- name: Set up Python
114135
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)