Skip to content

Commit

Permalink
upload wheels on tags only (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton authored Jun 21, 2024
1 parent 88ec09d commit 56d036a
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/build_and_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@ name: build and upload wheels

on:
push:
branches:
- main
jobs:
detect-version-changes:
uses: ./.github/workflows/check_version.yml
with:
file_path: pyproject.toml
tags:
- "v*"

jobs:
build-wheels-linux:
needs: detect-version-changes
# Run on main if version has changed
if: needs.detect-version-changes.outputs.version_changed == 'true'
name: build linux wheel
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -47,11 +40,8 @@ jobs:
path: dist/frozen-requirements.txt

build-sdist:
needs: detect-version-changes
name: Build source distribution
runs-on: ubuntu-latest
# Run on main if version has changed
if: needs.detect-version-changes.outputs.version_changed == 'true'
steps:
- uses: actions/checkout@v3

Expand All @@ -64,14 +54,12 @@ jobs:
path: dist/*.tar.gz

upload_pypi:
needs: [build-wheels-linux, build-sdist, detect-version-changes]
needs: [build-wheels-linux, build-sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
# Run on main if version has changed
if: needs.detect-version-changes.outputs.version_changed == 'true'
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v4
Expand All @@ -87,6 +75,6 @@ jobs:
- name: Upload dependency list to release
shell: bash
run: |
gh release upload ${{github.event.release.tag_name}} ./frozen-requirements.txt
gh release upload ${{github.ref_name}} ./frozen-requirements.txt
- name: Upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 56d036a

Please sign in to comment.