-
Notifications
You must be signed in to change notification settings - Fork 81
67 lines (67 loc) · 1.98 KB
/
publish-python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Publish Python Package
on:
push:
branches:
- master
paths-ignore:
- "CHANGELOG.md"
- "portal/__init__.py"
jobs:
publish-pypi-packages:
name: Publish PyPi Packages
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
architecture: "x64"
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install pip requirements
run: |
pip install pipenv
pipenv install --dev --system
- name: "Install, build and move frontend"
run: |
cd portal_frontend
yarn --frozen-lockfile
yarn build
mv build ../portal/frontend
- name: Release codeforlife-portal
uses: relekang/[email protected]
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
continue-on-error: true
- name: Build cfl-common package
run: |
pip install wheel
pushd cfl_common
python setup.py sdist bdist_wheel
popd
- name: Publish cfl-common package to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: cfl_common/dist/
skip_existing: true
- name: Trigger staging deployment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'ocadotechnology',
repo: 'codeforlife-deploy-appengine',
workflow_id: 'deploy_staging.yml',
ref: 'master',
});