Skip to content

Commit

Permalink
Update workflow and use pypi API token for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Crandel committed Apr 29, 2021
1 parent 58f5af8 commit f180edd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Expand Up @@ -10,15 +10,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Setup python and install packages
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
- name: Publish to pypi
if: success()
run: |
pip install "poetry>=1.0.2"
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry build
poetry publish --username "${{ secrets.PYPI_USER }}" --password "${{ secrets.PYPI_PASSWORD }}"
poetry publish
17 changes: 10 additions & 7 deletions .github/workflows/release-prep.yml
Expand Up @@ -10,15 +10,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Setup python and install packages
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
- name: Check version change
run: |
MASTER_VERSION="$(git show origin/master:pyproject.toml | sed -n -E "s/^version = \"(.+)\"/\1/p")"
git fetch origin master:master
MASTER_VERSION="$(git show master:pyproject.toml | sed -n -E "s/^version = \"(.+)\"/\1/p")"
NEW_VERSION="$(sed -n -E "s/^version = \"(.+)\"/\1/p" pyproject.toml)"
echo "Version on master: ${MASTER_VERSION}"
echo "Version on release-prep: ${NEW_VERSION}"
Expand All @@ -31,9 +32,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Setup python and install packages
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: x64
Expand All @@ -51,6 +52,7 @@ jobs:
mkdir -p ${HOME}/.esque
poetry config repositories.devpi http://localhost:3141/root/stable/
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Publish to devpi
if: success()
run: |
Expand All @@ -71,7 +73,8 @@ jobs:
if: success()
run: |
VERSION=$(sed -n -E "s/^version = \"(.+)\"/\1/p" pyproject.toml)
BUILD=$(git rev-list --count HEAD...origin/master)
git fetch origin master:master
BUILD=$(git rev-list --count HEAD...master)
sed -i -E "s/^version = .*/version = \"${VERSION}.dev${BUILD}\"/" pyproject.toml
poetry build
poetry publish --repository testpypi --username ${{ secrets.TEST_PYPI_USER }} --password ${{ secrets.TEST_PYPI_PASSWORD }}
poetry publish --repository testpypi
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Expand Up @@ -16,9 +16,9 @@ jobs:
python: ['3.6']
os: ['ubuntu-latest']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
Expand All @@ -37,7 +37,7 @@ jobs:
python: ['3.6', '3.7', '3.8' ]
librdkafka: ['1.1.0']
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Fetch virtualenv cache
uses: actions/cache@v1
id: venv-cache
Expand All @@ -52,7 +52,7 @@ jobs:
path: librdkafka
key: librdkafka-${{ matrix.librdkafka }}
- name: Setup python and install packages
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
Expand Down

0 comments on commit f180edd

Please sign in to comment.