Skip to content

Release on GitHub & PyPI #21

Release on GitHub & PyPI

Release on GitHub & PyPI #21

Workflow file for this run

name: Release on GitHub & PyPI
on:
push:
tags:
- "v*"
branches:
- main
pull_request_target:
branches:
- main
env:
CMEEL_LOG_LEVEL: DEBUG
jobs:
wheel:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: python -m pip install -U pip
- run: python -m pip wheel -vw wh .
- uses: actions/upload-artifact@v4
with:
name: "wheel"
path: wh/cmeel_urdfdom_headers*
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: setup
run: |
python -m pip install -U pip
python -m pip install build cmeel[build]
- name: build sdist
run: python -m build -nso dist .
- uses: actions/upload-artifact@v4
with:
name: "sdist"
path: dist
release:
needs: ["wheel", "sdist"]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- run: curl https://github.com/nim65s.gpg | gpg --import
- name: validate signature
run: >
git verify-tag --raw ${{ github.ref_name }} 2>&1
| grep -q 'VALIDSIG 9B1A79065D2F2B806C8A5A1C7D2ACDAF4653CF28'
- uses: actions/download-artifact@v4
- run: mkdir dist && mv wheel/* sdist/* dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
- run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- run: gh release create -t "Release ${{ env.TAG}}" "${{ env.TAG }}" dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}