Skip to content

Commit

Permalink
remove check for number of wheel artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Jan 4, 2024
1 parent e624d07 commit 5da9332
Showing 1 changed file with 46 additions and 47 deletions.
93 changes: 46 additions & 47 deletions .github/workflows/release-part-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:

publish_release:
# run this job if a PR was merged from an autorelease branch into main
# or if manually triggered, github.head_ref is undefined
if: ${{ ! github.head_ref || (startsWith(github.head_ref, 'autorelease') && github.event.pull_request.merged == true) }}
runs-on: ubuntu-latest
steps:
Expand All @@ -61,50 +62,48 @@ jobs:
--json databaseId \
--jq .[].databaseId)" >> $GITHUB_ENV
# - name: Download release artifacts
# run: |
# mkdir artifacts
# # this will download a folder containing each artifact
# gh run download $RUN_ID --dir artifacts --pattern "Wheel for *"
# # move the artifacts out of the folders
# mv artifacts/*/* artifacts
# rm -rf artifacts/Wheel*
# # verify that all 6 wheels are there
# if [ `find artifacts/* | wc -l` -ne 6 ]; then exit 1; fi

# # download each artifact separately so that the command will fail if any is missing
# for artifact in Workbench-Windows-binary \
# Workbench-macOS-binary \
# InVEST-sample-data \
# InVEST-user-guide \
# "Source distribution"
# do
# gh run download $RUN_ID --dir artifacts --name "$artifact"
# done

# - name: Create Github release
# run: |
# # Copy the history notes for this version into the release message
# echo "This release includes the following fixes and features:" > notes.rst
# echo "" >> notes.rst
# sed -n "/$VERSION/,/^$/p" HISTORY.rst | tail -n +3 >> notes.rst
# gh release create $VERSION \
# --verify-tag \
# --title $VERSION \
# --notes-file notes.rst \
# artifacts/*

# - name: Create a PyPI release
# # this is the only step that can't be rolled back
# run: |
# twine upload \
# --username="__token__" \
# --password=${{ secrets.PYPI_NATCAP_INVEST_TOKEN }} \
# artifacts/natcap.invest*

# - name: Roll back on failure
# if: failure()
# uses: ./.github/actions/rollback_release
# with:
# VERSION: ${{ env.VERSION }}
# GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
- name: Download release artifacts
run: |
mkdir artifacts
# this will download a folder containing each artifact
gh run download $RUN_ID --dir artifacts --pattern "Wheel for *"
# move the artifacts out of the folders
mv artifacts/*/* artifacts
rm -rf artifacts/Wheel*
# download each artifact separately so that the command will fail if any is missing
for artifact in Workbench-Windows-binary \
Workbench-macOS-binary \
InVEST-sample-data \
InVEST-user-guide \
"Source distribution"
do
gh run download $RUN_ID --dir artifacts --name "$artifact"
done
- name: Create Github release
run: |
# Copy the history notes for this version into the release message
echo "This release includes the following fixes and features:" > notes.rst
echo "" >> notes.rst
sed -n "/$VERSION/,/^$/p" HISTORY.rst | tail -n +3 >> notes.rst
gh release create $VERSION \
--verify-tag \
--title $VERSION \
--notes-file notes.rst \
artifacts/*
- name: Create a PyPI release
# this is the only step that can't be rolled back
run: |
twine upload \
--username="__token__" \
--password=${{ secrets.PYPI_NATCAP_INVEST_TOKEN }} \
artifacts/natcap.invest*
- name: Roll back on failure
if: failure()
uses: ./.github/actions/rollback_release
with:
VERSION: ${{ env.VERSION }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}

0 comments on commit 5da9332

Please sign in to comment.