Skip to content

Commit

Permalink
fix: Use Github Actions to publish rapid-router to PyPi (#1136)
Browse files Browse the repository at this point in the history
* ci: added draft publish-python-package workflow

* format publish python package and rename job

Signed-off-by: Niket <niket.shah1@ocado.com>

* Use personal github token

Signed-off-by: Niket <niket.shah1@ocado.com>
  • Loading branch information
mrniket authored Nov 26, 2020
1 parent 7f69153 commit e52dd23
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI
on: pull_request
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-18.04
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/publish-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Python Package
on:
workflow_run:
workflows: ['CI']
branches: [master]
types:
- completed
jobs:
publish-pypi-packages:
name: Publish PyPi Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6.7'
architecture: 'x64'
- name: Install pip requirements
run: |
pip install pipenv
pipenv install --dev --system
pip install -U git+https://github.com/ocadotechnology/codeforlife-portal.git#egg=codeforlife-portal #TODO: Remove as part of #688
pip install crowdin-cli-py
- name: Run Crowdin
run: |
mkdir -p game/locale
cd game && django-admin makemessages -l en_GB --no-wrap && cd -
cd game && django-admin makemessages -l en_GB --no-wrap -d djangojs --ignore "static/game/js/foundation/*" && cd - # some files from foundation use '_' for their own purpose
crowdin-cli-py upload sources
./.crowdin-get-translations
- name: Setup git username
run: |
git config --global user.name "semantic-release (via Github Actions)"
git config --global user.email "semantic-release@github-actions"
- name: Release rapid-router
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
- name: Trigger build on Semaphore
run: curl -d POST -v https://semaphoreci.com/api/v1/projects/${SEMAPHORE_PROJECT_ID}/master/build?auth_token=${SEMAPHORE_API_AUTH}
env:
SEMAPHORE_PROJECT_ID: ${{ secrets.SEMAPHORE_PROJECT_ID }}
SEMAPHORE_API_AUTH: ${{ secrets.SEMAPHORE_API_AUTH }}

0 comments on commit e52dd23

Please sign in to comment.