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
|
name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
with:
python-version: "3.13"
- name: Set pyproject.toml version from release tag
run: |
uv version "${GITHUB_REF##*/}"
- name: Install python
run: uv python install
- name: build
run: uv build
- name: Upload artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: package
path: dist/
retention-days: 7
if-no-files-found: error
pypi:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: gha
url: https://pypi.org/project/jenkinsapi/
steps:
- name: Download artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: package
path: dist
- name: Show tree
run: tree
- name: Publish
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
asset:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: package
path: dist
- name: Show tree
run: tree
- name: Add release asset
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090
with:
tag_name: ${{ github.event.release.tag_name }}
fail_on_unmatched_files: true
files: |
dist/*
|