Skip to content

Commit cb4b2ee

Browse files
committed
Publish workflow
1 parent bd9efc7 commit cb4b2ee

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.github/workflows/pr-check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request_target:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
check-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: refs/pull/${{ github.event.number }}/merge
18+
sparse-checkout: |
19+
RELEASE.md
20+
pyproject.toml
21+
sparse-checkout-cone-mode: false
22+
23+
- uses: autopub/autopub-action@v1.1.0
24+
with:
25+
command: check
26+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
id-token: write
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
has-release: ${{ steps.check.outputs.has-release }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: autopub/autopub-action@v1.1.0
21+
id: check
22+
with:
23+
command: check
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
release:
27+
needs: check
28+
if: needs.check.outputs.has-release == 'true'
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
token: ${{ github.token }}
35+
36+
- uses: autopub/autopub-action@v1.1.0
37+
with:
38+
command: prepare
39+
40+
- uses: autopub/autopub-action@v1.1.0
41+
with:
42+
command: build
43+
44+
- uses: autopub/autopub-action@v1.1.0
45+
with:
46+
command: publish
47+
github-token: ${{ github.token }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.pytest_cache/
33
__pycache__/
44
*.pyc
5+
.autopub/

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ packages = ["src/strawberry_autopub_plugins"]
2626

2727
[tool.pytest.ini_options]
2828
pythonpath = ["src"]
29+
30+
[tool.autopub]
31+
plugins = ["uv", "github"]

0 commit comments

Comments
 (0)