Skip to content

chore: Implementing Pypi publish and Tweet steps #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all 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.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@288f9339e0412e3038dce350e0da5ecdf12133a6
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.TWITTER_CONSUMER_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
continue-on-error: true