Skip to content

Commit 05a8c09

Browse files
authored
MRG: Merge pull request #39 from octue/fix-publishing-for-forks
Fix publishing for forks
2 parents 391d932 + ad95549 commit 05a8c09

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
permissions:
12+
id-token: write
13+
contents: read
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install Poetry
20+
uses: snok/install-poetry@v1.3.2
21+
22+
- name: Build a binary wheel and a source tarball
23+
run: poetry build
24+
25+
- name: Publish package distributions to PyPI
26+
uses: pypa/gh-action-pypi-publish@v1.12.4
27+
with:
28+
verbose: true

.github/workflows/cd.yml renamed to .github/workflows/release.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,19 @@
1-
name: cd
1+
name: release
22

33
# Only trigger when a pull request into main branch is merged
44
on:
55
pull_request:
6-
types: [closed]
6+
types: [ closed ]
77
branches:
88
- main
9-
workflow_dispatch:
109

1110
jobs:
12-
publish:
13-
# This job will only run if the PR has been merged (and not closed without merging).
14-
if: 'github.event.pull_request.merged == true'
15-
permissions:
16-
id-token: write
17-
contents: read
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Checkout repository
21-
uses: actions/checkout@v3
22-
23-
- name: Install Poetry
24-
uses: snok/install-poetry@v1.3.2
25-
26-
- name: Build a binary wheel and a source tarball
27-
run: poetry build
28-
29-
- name: Publish package distributions to PyPI
30-
uses: pypa/gh-action-pypi-publish@v1.12.4
31-
with:
32-
verbose: true
33-
3411
release:
35-
# This job will only run if the PR has been merged (and not closed without merging).
36-
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')"
12+
if: 'github.event.pull_request.merged == true'
3713
runs-on: ubuntu-latest
38-
needs: [publish]
3914
steps:
4015
- name: Checkout code
41-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
4217

4318
- name: Install poetry
4419
run: pip install poetry

0 commit comments

Comments
 (0)