-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add publish.yml GitHub Action job to upload urdfdom-py to PyPI #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,66 @@ | ||||||||||||||||||||||||||||
name: Publish Python distributions to PyPI | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||
push: | ||||||||||||||||||||||||||||
branches: ["**"] | ||||||||||||||||||||||||||||
tags-ignore: ["**"] | ||||||||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||||||||
release: | ||||||||||||||||||||||||||||
types: | ||||||||||||||||||||||||||||
- published | ||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||
build_wheels: | ||||||||||||||||||||||||||||
name: Build wheels [${{ matrix.os }}] | ||||||||||||||||||||||||||||
runs-on: ${{ matrix.os }} | ||||||||||||||||||||||||||||
strategy: | ||||||||||||||||||||||||||||
fail-fast: false | ||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||
python-version: | ||||||||||||||||||||||||||||
- 3.11 | ||||||||||||||||||||||||||||
os: | ||||||||||||||||||||||||||||
- ubuntu-24.04 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||
# We do not release exactly the 1.2.1 tag as we need | ||||||||||||||||||||||||||||
# to actually release on urdfdom-py | ||||||||||||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||
repository: 'ros/urdf_parser_py' | ||||||||||||||||||||||||||||
ref: '492223ce830cafc4dc2dcd98b82bb0eb91511118' | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- name: Set up Python | ||||||||||||||||||||||||||||
uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||
python-version: ${{ matrix.python-version }} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- name: Install pypa/build | ||||||||||||||||||||||||||||
run: pip install build | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- name: Build wheel and a source tarball | ||||||||||||||||||||||||||||
run: python -m build --sdist --wheel --outdir dist/ . | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- name: Archive artifacts | ||||||||||||||||||||||||||||
uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||
name: dist | ||||||||||||||||||||||||||||
path: dist | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
deploy: | ||||||||||||||||||||||||||||
name: Deploy to PyPI | ||||||||||||||||||||||||||||
runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||
Comment on lines
+49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wheel is pure python, so I do not think we do not need to publish a different one for each os, just uploading it on Linux is fine and will produce a package that should work fine also on macos. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok! I wasn't sure about this, but you're probably right |
||||||||||||||||||||||||||||
needs: [build_wheels] | ||||||||||||||||||||||||||||
if: startsWith(github.ref, 'refs/tags') | ||||||||||||||||||||||||||||
# Specifying a GitHub environment is optional, but strongly encouraged | ||||||||||||||||||||||||||||
environment: release | ||||||||||||||||||||||||||||
permissions: | ||||||||||||||||||||||||||||
# IMPORTANT: this permission is mandatory for trusted publishing | ||||||||||||||||||||||||||||
id-token: write | ||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||
- name: Download artifacts | ||||||||||||||||||||||||||||
uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||
name: dist | ||||||||||||||||||||||||||||
path: dist | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- name: Publish distribution to PyPI | ||||||||||||||||||||||||||||
uses: pypa/gh-action-pypi-publish@release/v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be okay