Skip to content

Commit

Permalink
Add creating draft GitHub releases for the lastest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Apr 29, 2024
1 parent 8d62485 commit 48157fa
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,59 @@ jobs:
${{ github.workspace }}/artifacts/*.whl
${{ github.workspace }}/artifacts/*.zip
${{ github.workspace }}/artifacts/*.gz
publish:
if: github.ref == 'refs/tags/latest'
needs:
- build
- package-docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
id: download
with:
path: ${{ github.workspace }}/artifacts
- name: Checksums
shell: bash
run: |
sha256sum $( find ${{ steps.download.outputs.download-path }} -type f -name "*.gz" "*.whl" -o -name "*.zip" ) > checksums.txt
echo "== checksums.txt =="
cat checksums.txt
- name: Create Release Notes
shell: bash
run: |
echo "This is an automatic pre-release packaging of SimpleITK based on the master branch. It contains the latest features and experimental developments.
To upgrade to the latest pre-release Python binary package run:
\`\`\`pip install --upgrade --pre SimpleITK --find-links https://github.com/SimpleITK/SimpleITK/releases/tag/latest\`\`\`
" >notes.txt
for f in $( find ${{ steps.download.outputs.download-path }} -type f )
do
if [[ $f == *.whl ]]; then
md5=$(md5sum $f | awk '{ print $1 }')
echo -n "<a href=\"https://github.com/SimpleITK/SimpleITK/releases/download/latest/$(basename $f)#${md5}\"></a>" >> notes.txt
fi
done
echo "== notes.txt =="
cat notes.txt
- name: Create Release and Upload Artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: |
gh release delete ${TAG_NAME}-draft --yes || true
gh release create ${TAG_NAME}-draft \
--target ${{ github.sha }} \
--draft \
--generate-notes \
--prerelease \
--notes-file notes.txt \
--title "Release ${{ github.ref_name }}"
gh release upload ${TAG_NAME}-draft $( find ${{ steps.download.outputs.download-path }} -type f -name "*.whl" -o -name "*.zip" -o -name "*.gz" )
>>>>>>> 18004da9 (WIP: Adding creating release to publish package)

0 comments on commit 48157fa

Please sign in to comment.