Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
# Dry-run triggers
pull_request:
branches:
- main
- master
workflow_dispatch:
# Publish trigger: only when the PR merge commits are pushed to main
push:
branches:
- main
- master

permissions:
contents: read # for checkout
Expand All @@ -21,8 +21,8 @@ jobs:
name: Dry-Run Build & Check
runs-on: ubuntu-latest

# Only on PRs or manual; skip on 'push to main'
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
# Allow dry-run on all events except when pushing to master
if: github.event_name != 'push' || github.ref != 'refs/heads/master'
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -43,7 +43,7 @@ jobs:
run: python -m twine check dist/*

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: built-package
path: dist/*
Expand All @@ -53,8 +53,8 @@ jobs:
runs-on: ubuntu-latest
needs: dry-run

# Only fire on the push-to-main that completes the PR
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
# Only fire on the push-to-master that completes the PR
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down