Skip to content

Git actions rework (switch). ReReReFix #100

Git actions rework (switch). ReReReFix

Git actions rework (switch). ReReReFix #100

name: Upload Release package to TestPyPI (with testing)
on:
pull_request:
types: [opened, reopened]
# ToDo remove after testing
push:
branches-ignore:
- master
jobs:
build:
name: Build project (Ubuntu)
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- name: Checkout PyReindexer
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
curl -L https://github.com/Restream/reindexer/raw/master/dependencies.sh | sudo bash -s
- name: Checkout Reindexer repo
uses: actions/checkout@v4
with:
repository: Restream/reindexer
path: reindexer
- name: Build Reindexer
run: |
cd reindexer
mkdir -p build && cd build
cmake ..
make -j8
sudo make install
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build PyReindexer
run: python -m build --sdist
- name: Store build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: dist/*
deploy:
name: Upload to TestPyPI (Ubuntu)
runs-on: ubuntu-22.04
needs: build
environment:
name: testpypi
url: https://test.pypi.org/p/pyreindexer/
# permissions:
# id-token: write
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v4
with:
name: build
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# ToDo skip-existing remove after testing
skip-existing: true
# verbose: true
# user: __token__ ## used as default
password: pypi-${{ secrets.TESTPYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
test:
strategy:
matrix:
os: [ubuntu-20.04,ubuntu-22.04,macos-14]
fail-fast: false
runs-on: ${{matrix.os}}
env:
OS: ${{matrix.os}}
PYTHON_VER: ${{ startsWith(matrix.os, 'macos') && '3.8' || '3.12' }}
needs: deploy
defaults:
run:
shell: bash
steps:
- name: Checkout PyReindexer
uses: actions/checkout@v4
- name: Install Reindexer (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
brew tap restream/reindexer
brew install reindexer
- name: Install Reindexer-Dev\Server (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
curl https://repo.reindexer.io/RX-KEY.GPG | sudo apt-key add
if [[ $OS == ubuntu-20.04 ]]; then
echo 'deb https://repo.reindexer.io/ubuntu-focal /' | sudo tee -a /etc/apt/sources.list
else
echo 'deb https://repo.reindexer.io/ubuntu-jammy /' | sudo tee -a /etc/apt/sources.list
fi
sudo apt-get update -y
sudo apt-get install -y libunwind-dev
sudo apt-get install -y reindexer-dev
sudo apt-get install -y reindexer-server
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VER }}
- name: Install PyReindexer
run: |
python -m pip install --upgrade pip importlib_metadata setuptools wheel
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps pyreindexer
- name: Prepare Test Environment
run: python -m pip install -r requirements.txt
- name: Test
run: |
case ${{ matrix.os }} in
*"macos"*)
cd /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyreindexer
;;
*"ubuntu"*)
cd $(python -c "import sysconfig; print(sysconfig.get_path('purelib'))")/pyreindexer
;;
esac
$GITHUB_WORKSPACE/github/workflows/test.sh