Skip to content

Commit ba5e000

Browse files
author
Martin Møldrup
committed
Fix release pipeline
1 parent 6575b83 commit ba5e000

File tree

1 file changed

+24
-42
lines changed

1 file changed

+24
-42
lines changed

.github/workflows/release.yaml

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,6 @@ jobs:
6565
else
6666
echo "The new version $NEW_VERSION is greater than the latest version $LATEST_VERSION on PyPI."
6767
fi
68-
69-
read_changelog:
70-
needs: details
71-
runs-on: ubuntu-latest
72-
outputs:
73-
changelog: ${{ steps.changelog.outputs.changelog }}
74-
steps:
75-
- uses: actions/checkout@v2
76-
77-
- name: Set up Python
78-
uses: actions/setup-python@v4
79-
with:
80-
python-version: "3.12"
81-
82-
- name: Get changelog and add to variable
83-
id: changelog
84-
run: |
85-
python ./scripts/get_changelog.py ${{ needs.details.outputs.new_version }} > specific_changelog.md
86-
echo "Changelog for ${{ needs.details.outputs.new_version }}:"
87-
cat specific_changelog.md
88-
echo "changelog=$(cat specific_changelog.md)" >> $GITHUB_ENV
89-
9068
setup_and_build:
9169
needs: [details, check_pypi]
9270
runs-on: ubuntu-latest
@@ -120,27 +98,9 @@ jobs:
12098
name: dist
12199
path: dist/
122100

123-
pypi_publish:
124-
name: Upload release to PyPI
125-
needs: [setup_and_build, details, read_changelog]
126-
runs-on: ubuntu-latest
127-
environment:
128-
name: release
129-
permissions:
130-
id-token: write
131-
steps:
132-
- name: Download artifacts
133-
uses: actions/download-artifact@v3
134-
with:
135-
name: dist
136-
path: dist/
137-
138-
- name: Publish distribution to PyPI
139-
uses: pypa/gh-action-pypi-publish@release/v1
140-
141101
github_release:
142102
name: Create GitHub Release
143-
needs: [setup_and_build, details, read_changelog]
103+
needs: [setup_and_build, details]
144104
runs-on: ubuntu-latest
145105
permissions:
146106
contents: write
@@ -161,4 +121,26 @@ jobs:
161121
env:
162122
GH_TOKEN: ${{ github.token }}
163123
run: |
164-
gh release create ${{ needs.details.outputs.tag_name }} dist/* --title ${{ needs.details.outputs.tag_name }} --generate-notes --notes "${{ needs.read_changelog.outputs.changelog }}"
124+
python ./scripts/get_changelog.py ${{ needs.details.outputs.new_version }} > specific_changelog.md
125+
echo "Changelog for ${{ needs.details.outputs.new_version }}:"
126+
cat specific_changelog.md
127+
changelog=$(cat specific_changelog.md)
128+
gh release create ${{ needs.details.outputs.tag_name }} dist/* --title ${{ needs.details.outputs.tag_name }} --generate-notes --notes "$changelog"
129+
130+
pypi_publish:
131+
name: Upload release to PyPI
132+
needs: [setup_and_build, details, github_release]
133+
runs-on: ubuntu-latest
134+
environment:
135+
name: release
136+
permissions:
137+
id-token: write
138+
steps:
139+
- name: Download artifacts
140+
uses: actions/download-artifact@v3
141+
with:
142+
name: dist
143+
path: dist/
144+
145+
- name: Publish distribution to PyPI
146+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)