Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/scripts/publish_preflight_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ echo_info ""
readonly ABOUT_FILE="firebase_admin/__about__.py"
echo_info "Loading version from: ${ABOUT_FILE}"

readonly VERSION_SCRIPT="exec(open('${ABOUT_FILE}').read()); print(__version__)"
readonly RELEASE_VERSION=`python -c "${VERSION_SCRIPT}"` || true
readonly RELEASE_VERSION=`grep "__version__" ${ABOUT_FILE} | awk '{print $3}' | tr -d \'` || true
if [[ -z "${RELEASE_VERSION}" ]]; then
echo_warn "Failed to extract release version from: ${ABOUT_FILE}"
terminate
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ jobs:
with:
name: dist

# Python is needed to run Twine and some of the preflight checks.
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.6

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine

- name: Publish preflight check
id: preflight
run: ./.github/scripts/publish_preflight_check.sh
Expand All @@ -131,11 +120,22 @@ jobs:
prerelease: false

- name: Publish to Pypi
run: echo Publishing to Pypi
uses: pypa/gh-action-pypi-publish@v1.0.0a0
with:
user: firebase
password: ${{ secrets.FIREBASE_PYPI_PASSWORD }}

# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
- name: Post to Twitter
if: success() &&
contains(github.event.pull_request.labels.*.name, 'release:tweet')
run: echo Posting Tweet
uses: ethomson/send-tweet-action@v1
with:
status: >
${{ steps.preflight.outputs.version }} of @Firebase Admin Python SDK is avaialble.
https://github.com/firebase/firebase-admin-python/releases/tag/${{ steps.preflight.outputs.version }}
consumer-key: ${{ secrets.FIREBASE_TWITTER_CONSUMER_KEY }}
consumer-secret: ${{ secrets.FIREBASE_TWITTER_CONSUMER_SECRET }}
access-token: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN_SECRET }}
continue-on-error: true