Pixi-Release #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/pixi.yml | |
| name: Pixi-Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| # Elle tetiklemek için — Actions sekmesinden "Run workflow" butonu çıkar | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: "Dry run (build et ama prefix.dev'e yükleme)" | |
| required: false | |
| default: "false" | |
| type: choice | |
| options: | |
| - "false" | |
| - "true" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| test: | |
| name: Test (linux-64) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@v0.9.6 | |
| with: | |
| pixi-version: v0.47.0 | |
| cache: true | |
| auth-host: prefix.dev | |
| auth-token: ${{ secrets.PIXI_TOKEN }} | |
| - name: Lint | |
| run: pixi run lint | |
| - name: Test | |
| run: pixi run test | |
| build-and-publish: | |
| name: Build & Publish conda package | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build conda package | |
| uses: prefix-dev/rattler-build-action@v0.2.38 | |
| with: | |
| recipe-path: conda.recipe/recipe.yaml | |
| build-args: >- | |
| --target-platform linux-64 | |
| -c conda-forge | |
| -c https://prefix.dev/conda-forge | |
| upload-artifact: true | |
| artifact-name: conda-package-linux-64 | |
| - name: Upload to prefix.dev | |
| # dry_run "true" ise veya hiç input yoksa (tag push) yükleme yapılır | |
| # dry_run "true" seçildiyse bu adım atlanır | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| shell: bash | |
| env: | |
| PIXI_TOKEN: ${{ secrets.PIXI_TOKEN }} | |
| run: | | |
| for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \)); do | |
| echo "Uploading: $pkg" | |
| rattler-build upload prefix \ | |
| --channel kececinumbers \ | |
| --api-key "$PIXI_TOKEN" \ | |
| "$pkg" || echo "Warning: duplicate, skipping" | |
| done | |
| - name: Dry run info | |
| if: ${{ github.event.inputs.dry_run == 'true' }} | |
| run: | | |
| echo "=== DRY RUN — yükleme yapılmadı ===" | |
| find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) | |
| # ──────────────────────────────────────────────────────────── | |
| # JOB 3: PyPI'ya da yayınla (opsiyonel) | |
| # ──────────────────────────────────────────────────────────── | |
| publish-pypi: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: test | |
| environment: pypi # GitHub Environment ile koruma (opsiyonel) | |
| permissions: | |
| contents: read | |
| id-token: write # PyPI trusted publishing için | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@v0.9.6 | |
| with: | |
| pixi-version: v0.47.0 | |
| cache: true | |
| - name: Build Python package | |
| run: pixi run build # python -m build → dist/ klasörüne yazar | |
| #- name: Publish to PyPI | |
| #uses: pypa/gh-action-pypi-publish@release/v1 | |
| # Trusted publishing kullandığında api-token gerekmez | |
| # Eğer API token kullanıyorsan aşağıyı aç: | |
| # with: | |
| # password: ${{ secrets.PYPI_API_TOKEN }} |