Skip to content

Commit d91ad31

Browse files
committed
Merge branch 'main' of github.com:FlyweightGroup/aws_sqs_consumer_python
2 parents 1a9e984 + e0322a9 commit d91ad31

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Upload Python Package PyPI
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
deploy:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.8"
16+
17+
- name: Install dependencies
18+
run: |
19+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
20+
$HOME/.poetry/bin/poetry install
21+
22+
- name: Build package
23+
run: $HOME/.poetry/bin/poetry build
24+
25+
- name: Setup PyPI in poetry
26+
env:
27+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
28+
run: |
29+
touch $HOME/.pypirc
30+
echo "[pypi]" >> $HOME/.pypirc
31+
echo " username = __token__" >> $HOME/.pypirc
32+
echo " password = $PYPI_API_TOKEN" >> $HOME/.pypirc
33+
$HOME/.poetry/bin/poetry config pypi-token.pypi "$PYPI_API_TOKEN"
34+
35+
- name: Publish package to PyPI
36+
run: |
37+
$HOME/.poetry/bin/poetry publish

.github/workflows/publish-test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Upload Python Package to test.pypi.org
2+
3+
on:
4+
release:
5+
types: [published]
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: "3.8"
20+
21+
- name: Install dependencies
22+
run: |
23+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
24+
$HOME/.poetry/bin/poetry install
25+
26+
- name: Build package
27+
run: $HOME/.poetry/bin/poetry build
28+
29+
- name: Setup Test PyPI in poetry
30+
env:
31+
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
32+
run: |
33+
touch $HOME/.pypirc
34+
echo "[testpypi]" >> $HOME/.pypirc
35+
echo " username = __token__" >> $HOME/.pypirc
36+
echo " password = $TEST_PYPI_API_TOKEN" >> $HOME/.pypirc
37+
$HOME/.poetry/bin/poetry config repositories.test-pypi https://test.pypi.org/legacy/
38+
$HOME/.poetry/bin/poetry config pypi-token.test-pypi "$TEST_PYPI_API_TOKEN"
39+
40+
- name: Publish package to test.pypi.org
41+
run: |
42+
$HOME/.poetry/bin/poetry publish -r test-pypi
43+

0 commit comments

Comments
 (0)