-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use Github Actions to publish rapid-router to PyPi (#1136)
* 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
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |