Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IO-1402][internal] Refactoring deployment #17

Merged
merged 24 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
tags:
- "v*.*.*"
- "test-*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build wheels
uses: pypa/cibuildwheel@v2.14.1
with:
package-dir: .
output-dir: dist
config-file: "{package}/pyproject.toml"

- uses: actions/upload-artifact@v3
if: ${{ env.RELEASE_VERSION != ''}}
with:
name: ${{ env.RELEASE_VERSION }}-wheels
retention-days: 15
path: dist/*.whl

build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py sdist
- uses: actions/upload-artifact@v2
if: ${{ env.RELEASE_VERSION != ''}}
with:
name: ${{ env.RELEASE_VERSION }}-sdist
retention-days: 15
path: dist/*.tar.gz
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy

on:
release:
types: [created]
workflow_dispatch:

jobs:

retrieve_artifacts:
runs-on: ubuntu-latest
steps:
- name: Retrieve wheel artifacts for release
uses: actions/download-artifact@v3
with:
name: ${{ github.event.release.name }}-wheels
path: dist/*.whl
- name: Retrieve SDIST artifacts for release
uses: actions/download-artifact@v3
with:
name: ${{ github.event.release.name }}-sdist
path: dist/*.tar.gz

deploy:
needs: retrieve_artifacts
runs-on: ubuntu-latest
steps:
- name: Release code as new release on Pypi
if: ${{ startsWith(github.event.release.name,'v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
repository-url: https://PREVENTFORTESTING.upload.pypi.org/legacy/
verbose: true

- name: "TEST: Release code as new release on Test Pypi"
if: ${{ startsWith(github.event.release.name,'test-') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
verbose: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Python package

on: [pull_request]
on: [pull_request, workflow_dispatch]

jobs:
build:
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/pythonpublish_linux.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/pythonpublish_mac.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/pythonpublish_sdist.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/pythonpublish_windows.yml

This file was deleted.

Loading