This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36f835e
commit dcd2af7
Showing
2 changed files
with
75 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |