Skip to content
Merged
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
32 changes: 27 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,23 @@ jobs:
build:
name: Build and publish library
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Install dependencies and build the library
id: build
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/requirements_build.txt
python -m build venv wheel
python -m twine check dist/*
version=$(ls dist | grep rep_client | grep -E -o "[0-9]+.[0-9]+.[a-z0-9]+")
echo "version=$version" >> $GITHUB_OUTPUT
#- name: Upload to private PyPi
# if: github.ref == 'refs/heads/main'
# run: |
Expand All @@ -185,14 +190,31 @@ jobs:

release:
name: "Release"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/heads/main') || github.ref_type == 'tag'
needs: [build, docs]
runs-on: ubuntu-latest
steps:
- name: "Release to GitHub"
- uses: actions/download-artifact@v3
with:
name: pyrep-package
path: /tmp/artifacts

- name: List artifacts
run: ls -ltR /tmp/artifacts

- name: Release for tag
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
# files: |
# dist/*.whl
# build/sphinx/html
files: |
/tmp/artifacts/*.whl

- name: Release for latest-dev
if: startsWith(github.ref, 'refs/heads/main')
uses: softprops/action-gh-release@v1
with:
name: ${{needs.build.outputs.version}}
prerelease: true
files: |
/tmp/artifacts/*.whl