/
niceSOFT
/
python3-pytest
Обзор
Документация
Войти
/
niceSOFT
/
python3-pytest
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.4.2
.github/workflows/deploy.yml
116 строк
3 KB
Ran Benita
Merge pull request #13524 from bluetech/gh-release
18 июн 2025, 10:15
18 июн 2025, 10:15
9bce91e
Код
Авторство
О чём код?
name: deploy on: workflow_dispatch: inputs: version: description: 'Release version' required: true default: '1.2.3' # Set permissions at the job level. permissions: {} jobs: package: runs-on: ubuntu-latest env: SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }} timeout-minutes: 10 # Required by attest-build-provenance-github. permissions: id-token: write attestations: write steps: - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - name: Build and Check Package uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 with: attest-build-provenance-github: 'true' deploy: if: github.repository == 'pytest-dev/pytest' needs: [package] runs-on: ubuntu-latest environment: deploy timeout-minutes: 30 permissions: id-token: write contents: write steps: - uses: actions/checkout@v4 with: persist-credentials: true - name: Download Package uses: actions/download-artifact@v4 with: name: Packages path: dist - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc with: attestations: true - name: Push tag env: VERSION: ${{ github.event.inputs.version }} run: | git config user.name "pytest bot" git config user.email "pytestbot@gmail.com" git tag --annotate --message=v"$VERSION" "$VERSION" ${{ github.sha }} git push origin "$VERSION" release-notes: # todo: generate the content in the build job # the goal being of using a github action script to push the release data # after success instead of creating a complete python/tox env needs: [deploy] runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: write steps: - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - name: Download Package uses: actions/download-artifact@v4 with: name: Packages path: dist - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install tox run: | python -m pip install --upgrade pip pip install --upgrade tox - name: Generate release notes env: VERSION: ${{ github.event.inputs.version }} run: | sudo apt-get install pandoc tox -e generate-gh-release-notes -- "$VERSION" scripts/latest-release-notes.md - name: Publish GitHub Release env: VERSION: ${{ github.event.inputs.version }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create --notes-file scripts/latest-release-notes.md --verify-tag "$VERSION" dist/*