Skip to content

v1.1.0-rc2

v1.1.0-rc2 #43

Workflow file for this run

# 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 Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Edit version
run: sed -i 's/version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/g' pyproject.toml
- name: Make the script files executable
run: chmod +x ./database/build.sh
- name: Run a script
working-directory: ./database
run: ./build.sh
- name: Move file
run: mv ./database/pg_deploy.sql ./cli/dataforge/resources/
- name: Save pgdeploy file
uses: actions/upload-artifact@v4
with:
name: pgdeploy
path: ./cli/dataforge/resources/pg_deploy.sql
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: publish python distribution to TestPyPi
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/dataforge-core
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: publish dist to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-prodpypi:
if: "!github.event.release.prerelease"
name: publish python distribution to ProdPyPi
needs:
- build
runs-on: ubuntu-latest
environment:
name: prodpypi
url: https://pypi.org/p/dataforge-core
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: publish dist to ProdPyPI
uses: pypa/gh-action-pypi-publish@release/v1