-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (142 loc) · 5.32 KB
/
Copy pathpixi.yml
File metadata and controls
162 lines (142 loc) · 5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# .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
permissions:
contents: write # commit push edebilmek için
steps:
- name: Checkout
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # tam git geçmişi (commit için gerekli)
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.70.2
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.PIXI_TOKEN }}
frozen: false # lock dosyası yoksa veya eskiyse yeniden çöz
locked: false # lock dosyasını zorunlu tutma
- name: Update lock file (değişmişse commit'le)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet pixi.lock; then
git add pixi.lock
git commit -m "chore: update pixi.lock [skip ci]"
git push
else
echo "pixi.lock değişmedi."
fi
- name: Format & lint (auto-fix)
run: |
pixi run fmt
pixi run fix || true # fix edilemeyen uyarılar CI'yı durdurmasın
- name: Commit lint fixes (varsa)
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Değişiklik yoksa bu adım sessizce geçer
if ! git diff --quiet; then
git add -A
git commit -m "style: auto-fix ruff lint [skip ci]"
git push
else
echo "Lint düzeltmesi gerekmedi."
fi
- 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@v7
- name: Update recipe version & sha256
run: |
VERSION="${GITHUB_REF_NAME#v}"
SHA256=$(curl -sL "https://pypi.org/packages/source/k/kececinumbers/kececinumbers-${VERSION}.tar.gz" | sha256sum | cut -d' ' -f1)
sed -i "s/^version: .*/version: \"${VERSION}\"/" recipe.yaml
sed -i "s/^sha256: .*/sha256: ${SHA256}/" recipe.yaml
echo "Version: $VERSION, SHA256: $SHA256"
- name: Build conda package
uses: prefix-dev/rattler-build-action@v0.2.38
with:
recipe-path: recipe.yaml # ana dizin
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
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 hesabiniz/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@v7
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.70.2
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 }}
- name: 🏗️ Paket Derle ve prefix.dev'e Yayınla (Trusted Publishing)
# URL'in sonuna kendi kanal adınızı ekleyin
run: pixi publish --target-channel https://prefix.dev/bilgi