From fdc2870545883a13a4188c1403cd44248e169184 Mon Sep 17 00:00:00 2001 From: maxim-lixakov Date: Fri, 9 Feb 2024 12:11:40 +0300 Subject: [PATCH] [DOP-11677] - add workflow for dev release to test.pypi --- .github/workflows/dev-release.yaml | 61 ++++++++++++++++++++++++++++++ README.rst | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dev-release.yaml diff --git a/.github/workflows/dev-release.yaml b/.github/workflows/dev-release.yaml new file mode 100644 index 0000000..bae281c --- /dev/null +++ b/.github/workflows/dev-release.yaml @@ -0,0 +1,61 @@ +name: Dev release + +on: + push: + branches-ignore: + - dependabot/** + - pre-commit-ci-update-config + - master + workflow_dispatch: + +env: + DEFAULT_PYTHON: '3.12' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + wait-code-analysis: + name: Release package + runs-on: ubuntu-latest + if: github.repository == 'MobileTeleSystems/horizon' # prevent running on forks + + environment: + name: test-pypi + url: https://test.pypi.org/p/data-horizon + permissions: + id-token: write # to auth in Test PyPI + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + + - name: Install poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Generate unique version identifier and update test version + run: | + UNIQUE_SHA=$(git rev-parse --short HEAD) + poetry version prepatch + NEW_VERSION=$(poetry version | awk '{print $2}') + poetry version "$NEW_VERSION.dev$UNIQUE_SHA" + + - name: Build package + run: poetry build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/README.rst b/README.rst index f26a70b..7ea5818 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ Horizon .. |Logo| image:: docs/_static/logo.svg :width: 400 :alt: Horizon logo - :target: https://gitlab.services.mts.ru/bigdata/platform/onetools/horizon + :target: https://github.com/MobileTeleSystems/horizon/ What is Horizon? ----------------