Skip to content

Commit abfeb69

Browse files
committed
remove hashes from version. upload to pypi in same step as S3
1 parent 5a22a0f commit abfeb69

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ jobs:
6363
run: |
6464
python -m pip install --upgrade pip
6565
pip install setuptools wheel twine
66-
- name: Publish stubs
67-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
68-
env:
69-
TWINE_USERNAME: ${{ secrets.pypi_username }}
70-
TWINE_PASSWORD: ${{ secrets.pypi_password }}
71-
run: |
72-
python setup.py sdist
73-
twine upload dist/*
7466
- name: Test Documentation Build (HTML)
7567
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
7668
- uses: actions/upload-artifact@v2
@@ -126,19 +118,24 @@ jobs:
126118
name: mpy-cross.static-x64-windows
127119
path: mpy-cross/mpy-cross.static.exe
128120
- name: Upload stubs and mpy-cross builds to S3
121+
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
122+
env:
123+
AWS_PAGER: ''
124+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
125+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
126+
TWINE_USERNAME: ${{ secrets.pypi_username }}
127+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
129128
run: |
130129
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-aarch64 s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-aarch64-${{ env.CP_VERSION }} --no-progress --region us-east-1
131130
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1
132131
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1
133132
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1
134133
zip -9r circuitpython-stubs.zip circuitpython-stubs
135134
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1
136-
env:
137-
AWS_PAGER: ''
138-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
139-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
140-
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
141-
135+
if [[ -z "${{steps.need-pypi.outputs.setup-py}}" && -z "$TWINE_PASSWORD" ]]; then
136+
python setup.py sdist
137+
twine upload dist/*
138+
fi
142139
143140
mpy-cross-mac:
144141
runs-on: macos-10.15

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
# Detect a development build and mutate it to be valid semver and valid python version.
2121
pieces = version.split("-")
2222
if len(pieces) > 2:
23-
# Merge the commit portion onto the commit count since the tag.
24-
pieces[-2] += "+" + pieces[-1]
2523
pieces.pop()
2624
# Merge the commit count and build to the pre-release identifier.
2725
pieces[-2] += ".dev." + pieces[-1]

0 commit comments

Comments
 (0)