Skip to content

Commit 346d7c6

Browse files
committed
OPS: Ensure publish works for forks
1 parent 391d932 commit 346d7c6

File tree

3 files changed

+59
-59
lines changed

3 files changed

+59
-59
lines changed

.github/workflows/cd.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.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/[email protected]
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/[email protected]
27+
with:
28+
verbose: true

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Install poetry
16+
run: pip install poetry
17+
18+
- name: Get package version
19+
id: version
20+
run: echo "::set-output name=package_version::$(poetry version -s)"
21+
22+
- name: Create release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own.
26+
with:
27+
tag_name: ${{ steps.version.outputs.package_version }}
28+
release_name: ${{ github.event.pull_request.title }}
29+
body: ${{ github.event.pull_request.body }}
30+
draft: false
31+
prerelease: false

0 commit comments

Comments
 (0)