Skip to content

Commit 1e118de

Browse files
authored
ci: Fix conditions for building and publishing (#313)
* ci: Fix conditions for building and publishing Based ont he github documentation: github.events.ref: Is the ref of a release that has been created github.ref: If the branch that is being used (depending on the action) - create a release: It will be refs/tags/<tag_name> - create a pull request: It will be refs/pull/<pr_number>/merge - push to a branch: It will be refs/heads/<branch_name> For publishing to pypi, we are targeting the "create a release" event. In which case: - github.events.ref will be refs/tags/<tag_name> - github.ref will also be refs/tags/<tag_name> So, it looks like our IF condition was incorrect. Ref: https://docs.github.com/en/actions/learn-github-actions/environment-variables * ci: Remove github.event.ref and use github.ref The github.event.ref and github.ref will always be same for the "push" event. So, we don't need to use github.event.ref in general.
1 parent 8dc63f3 commit 1e118de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272

7373
builder_pypandoc_binary:
7474
needs: [test]
75-
if: github.ref == 'refs/heads/master'
75+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
7676
strategy:
7777
matrix:
7878
# Ref: https://cibuildwheel.readthedocs.io/en/stable/options/#archs
@@ -103,7 +103,7 @@ jobs:
103103

104104
publisher_release:
105105
needs: [builder_pypandoc, builder_pypandoc_binary]
106-
if: startsWith(github.event.ref, 'refs/tags/v') && github.ref == 'refs/heads/master'
106+
if: startsWith(github.ref, 'refs/tags/v')
107107
runs-on: ubuntu-latest
108108
steps:
109109
- name: Check out repository

0 commit comments

Comments
 (0)