/
niceSOFT
/
python3-trove_classifiers
Обзор
Документация
Войти
/
niceSOFT
/
python3-trove_classifiers
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/release.yml
76 строк
2 KB
Facundo Tuesca
Restrict OIDC token to publish job (#249)
01 июн 2026, 22:40
Не верифицирован
01 июн 2026, 22:40
71cb041
Код
Авторство
О чём код?
name: Release on: push: branches: - main workflow_dispatch: jobs: build: if: github.repository_owner == 'pypa' runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' cache: pip cache-dependency-path: .github/workflows/release.yml - name: Lint run: make lint - name: Test run: make test - name: Install build dependencies run: pip install -U setuptools wheel build calver - name: Build run: python -m build . - name: Upload dist uses: actions/upload-artifact@v4 with: name: dist path: dist/ if-no-files-found: error publish: if: github.repository_owner == 'pypa' needs: build runs-on: ubuntu-latest permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write steps: - name: Download dist uses: actions/download-artifact@v4 with: name: dist path: dist - name: Publish uses: pypa/gh-action-pypi-publish@release/v1 release: if: github.repository_owner == 'pypa' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' cache: pip cache-dependency-path: .github/workflows/release.yml - name: Install build dependencies run: pip install -U setuptools wheel build calver - name: Version id: version run: echo "version=$(python setup.py --version 2>/dev/null)" >> $GITHUB_OUTPUT - name: Tag uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.version.outputs.version }} release_name: ${{ steps.version.outputs.version }} draft: false prerelease: false