Skip to content

Commit 70992f6

Browse files
authored
Merge pull request #26 from FusionAuth/jj/release-workflow
add deploy workflow
2 parents 88ebe3b + d5d12e5 commit 70992f6

2 files changed

Lines changed: 103 additions & 5 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Run locally with act:
2+
#
3+
# act pull_request [--input command=[command]] \
4+
# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \
5+
# --workflows ./.github/workflows/release.yaml \
6+
# --env-file <(aws configure export-credentials --profile [aws-profile] --format env)
7+
8+
name: Deploy
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
pull_request:
15+
branches:
16+
- main
17+
workflow_dispatch:
18+
inputs:
19+
command:
20+
type: choice
21+
options:
22+
- build # build only
23+
- publish # build & publish to pypi
24+
- release # build & release to svn
25+
default: build
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
build:
32+
if: |
33+
github.event_name == 'pull_request' ||
34+
github.event_name == 'push' ||
35+
github.event_name == 'workflow_dispatch' && inputs.command == 'build'
36+
runs-on: fusionauth-builder
37+
steps:
38+
- name: checkout
39+
uses: actions/checkout@v4
40+
41+
- name: compile
42+
shell: bash -l {0}
43+
run: sb compile
44+
45+
deploy:
46+
if: |
47+
github.event_name == 'workflow_dispatch' &&
48+
(inputs.command == 'release' || inputs.command == 'publish')
49+
runs-on: fusionauth-builder
50+
steps:
51+
- name: checkout
52+
uses: actions/checkout@v4
53+
54+
- name: set aws credentials
55+
uses: aws-actions/configure-aws-credentials@v4
56+
with:
57+
role-to-assume: arn:aws:iam::752443094709:role/github-actions
58+
role-session-name: aws-auth-action
59+
aws-region: us-west-2
60+
61+
- name: get secret
62+
run: |
63+
while IFS=$'\t' read -r key value; do
64+
echo "::add-mask::${value}"
65+
echo "${key}=${value}" >> $GITHUB_ENV
66+
done < <(aws secretsmanager get-secret-value \
67+
--region us-west-2 \
68+
--secret-id platform/pypi \
69+
--query SecretString \
70+
--output text | \
71+
jq -r 'to_entries[] | [.key, .value] | @tsv')
72+
73+
- name: set pypi credentials
74+
run: |
75+
cat << EOF > ~/.pypirc
76+
[distutils]
77+
index-servers =
78+
pypi
79+
fusionauth-client
80+
[pypi]
81+
username = __token__
82+
password = ${{ env.API_KEY }}
83+
[fusionauth-client]
84+
repository = https://upload.pypi.org/legacy/
85+
username = __token__
86+
password = ${{ env.API_KEY }}
87+
EOF
88+
89+
- name: release to svn
90+
if: inputs.command == 'release'
91+
shell: bash -l {0}
92+
run: sb release
93+
94+
- name: publish to pypi
95+
if: inputs.command == 'publish'
96+
shell: bash -l {0}
97+
run: sb publish

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@
66
setup(
77
name="fusionauth-client",
88
version="1.51.0",
9-
author="Tyler Scott",
9+
author="FusionAuth",
1010
author_email="dev@fusionauth.io",
1111
description="A client library for FusionAuth",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
url="https://github.com/FusionAuth/fusionauth-python-client",
15-
packages=find_packages(where='src/main/python'),
15+
packages=find_packages(where="src/main/python"),
1616
namespace_packages=["fusionauth"],
17-
package_dir={'': 'src/main/python'},
17+
package_dir={"": "src/main/python"},
1818
classifiers=[
1919
"Programming Language :: Python :: 3",
2020
"License :: OSI Approved :: Apache Software License",
2121
"Operating System :: OS Independent",
2222
"Topic :: Software Development :: Libraries",
2323
],
2424
install_requires=[
25-
'deprecated', 'requests',
26-
]
25+
"deprecated",
26+
"requests",
27+
],
2728
)

0 commit comments

Comments
 (0)