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

Commit

Permalink
CI: improve release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgepiloto committed May 7, 2023
1 parent 36f835e commit dcd2af7
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 16 deletions.
24 changes: 11 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,14 @@ workflows:
- quality
- release:
requires:
- quality
#requires:
# - tests38-fast
# - tests38-online
# - tests38-slow
# - tests38-images
# - tests38-coverage
# - tests39
# - tests310
# - tests311
#filters:
# tags:
# only: /^v\d+.\d+.\d+$/
- tests38-fast
- tests38-online
- tests38-slow
- tests38-images
- tests38-coverage
- tests39
- tests310
- tests311
filters:
tags:
only: /^v\d+.\d+.\d+$/
67 changes: 64 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,74 @@
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 }}
needs: code-style
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"
name: "Release poliastro"
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: "Verify repository dispatch"

- 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: |
echo "SUCCESS"
python -m twine upload --verbose --skip-existing dist/*.whl
python -m twine upload --verbose --skip-existing dist/*.tar.gz

0 comments on commit dcd2af7

Please sign in to comment.