Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Release

Release #10

Workflow file for this run

name: "Release"
on:
# HACK: this workflow can only be triggered by a workflow dispatch comming
# from the CircleCI pipelines. This is the only way to guarantee the right
# execution order of the different steps involved in the global CI/CD
# pipeline.
workflow_dispatch:
env:
MAIN_PYTHON_VERSION: '3.10'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-library:
name: "Build poliastro in ${{ matrix.os }} with Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: "Checkout project"
uses: actions/checkout@v3
- name: "Install Python ${{ matrix.os }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: "Install dependencies"
run: |
python -m pip install -U pip build twine
- name: "Build distribution artifacts"
run: |
python -m build .
- name: "Verify healthy of artifacts"
run: |
python -m twine check dist/*
- name: "Upload artifacts"
uses: actions/upload-artifact@v2
with:
name: "poliastro-dist-${{ matrix.os }}-py${{ matrix.python-version }}"
path: dist
release:
name: "Release poliastro"
needs: build-library
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: "Download all artifacts"
uses: actions/download-artifact@v3
with:
path: dist
- name: "Upload artifacts to private PyPI"
shell: bash
if: inputs.dry-run == 'false'
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload --verbose --skip-existing dist/*.whl
python -m twine upload --verbose --skip-existing dist/*.tar.gz