Skip to content

CI: Use trusted publishing instead of token #23

CI: Use trusted publishing instead of token

CI: Use trusted publishing instead of token #23

Workflow file for this run

name: "Local Remote Testing"
on:
push:
paths:
- ".github/workflows/remote.yml"
- "bincrafters_conan_remote/helper.py"
- "bincrafters_conan_remote/main.py"
- "bincrafters_conan_remote/remote.py"
- "bincrafters_conan_remote/requirements.txt"
- "bincrafters_conan_remote/requirements_dev.txt"
- "setup.py"
pull_request:
paths:
- ".github/workflows/remote.yml"
- "bincrafters_conan_remote/helper.py"
- "bincrafters_conan_remote/main.py"
- "bincrafters_conan_remote/remote.py"
- "bincrafters_conan_remote/requirements.txt"
- "bincrafters_conan_remote/requirements_dev.txt"
- "setup.py"
jobs:
test:
name: "Tests"
runs-on: ubuntu-22.04
env:
CONAN_LOGGING_LEVEL: 10
strategy:
fail-fast: false
matrix:
python_version:
- "3.8"
- "3.12"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install package
run: |
pip install .
- name: Start Local Server
run: |
bincrafters-conan-remote run & disown
- name: Configure Conan
run: |
conan --version
conan user
conan config set general.revisions_enabled=1
conan remote remove conancenter
conan remote add inexorgame "http://127.0.0.1:8042/r/github+bincrafters_remote+testing_v-998+inexorgame/"
conan remote list
- name: Tests
run: |
# conan download latest revision
conan download -r inexorgame --recipe InexorGlueGen/0.6.11@inexorgame/stable
# conan download specific revision
conan download -r inexorgame --recipe grpc/1.34.1@inexorgame/stable#0
# conan download with no explicit remote
conan download --recipe v8/7.6.66@inexorgame/testing
# conan download with default remote configuration, not explicit
conan remote remove inexorgame
conan remote add inexorgame "http://127.0.0.1:8042/"
conan download --recipe Protobuf/3.5.1@inexorgame/stable#0
deploy:
name: Deploy to PyPi
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: test
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build
run: |
pip install setuptools wheel
python setup.py sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1