forked from ethyca/fides
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.68 KB
/
publish_package.yaml
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
68
name: Publish fidesctl
on:
push:
branches:
- main
tags:
- "*"
jobs:
upload_to_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # This is required to properly tag packages
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install node modules
run: |
cd clients/ctl/admin-ui
npm install
- name: Build and export frontend files
run: |
cd clients/ctl/admin-ui
npm run prod-export
- name: Install Twine and wheel
run: pip install twine wheel
# The git reset is required here because the build modifies
# egg-info and the wheel becomes a dirty version
- name: Build the sdist
run: |
python setup.py sdist
git reset --hard
- name: Build the wheel
run: python setup.py bdist_wheel
- name: Upload to test pypi
run: twine upload --repository testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
- name: Check Prod Tag
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- name: Upload to pypi
if: steps.check-tag.outputs.match == 'true'
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}