Skip to content

Commit

Permalink
Actions for publish (#88)
Browse files Browse the repository at this point in the history
Actions for publish.
  • Loading branch information
amorilla authored May 13, 2023
1 parent f0b7839 commit dd15952
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Test Python Package

on:
release:
types: [published]
branches:
- master

permissions:
contents: read

jobs:
pypi-publish:
runs-on: ubuntu-20.04
permissions:
id-token: write
steps:
- name: Install gettext
run: sudo apt-get install -y gettext

- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U django django-storages boto3 wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/

50 changes: 50 additions & 0 deletions .github/workflows/test-python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Test Python Package

on:
release:
types: [published]
branches:
- master

permissions:
contents: read

jobs:
pypi-publish:
runs-on: ubuntu-20.04
permissions:
id-token: write
steps:
- name: Install gettext
run: sudo apt-get install -y gettext

- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U django django-storages boto3 wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

0 comments on commit dd15952

Please sign in to comment.