-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 2.02 KB
/
release.yaml
File metadata and controls
66 lines (57 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
with:
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
# Update uv.lock when release PR is created/updated
- name: Checkout repository (for PR update)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ steps.release.outputs.pr }}
with:
ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
- name: Setup Nix (for PR update)
if: ${{ steps.release.outputs.pr }}
uses: ./.github/actions/setup-nix
with:
skip-uv-sync: "true"
- name: Update uv.lock
if: ${{ steps.release.outputs.pr }}
run: |
nix develop --command uv lock
if git diff --quiet uv.lock; then
echo "uv.lock is already up to date"
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add uv.lock
git commit -m "chore: update uv.lock"
git push
fi
# Only release to PyPI when a new release is created
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ steps.release.outputs.release_created }}
- name: Setup Nix
if: ${{ steps.release.outputs.release_created }}
uses: ./.github/actions/setup-nix
with:
skip-uv-sync: "true"
- name: Build and publish package
if: ${{ steps.release.outputs.release_created }}
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
nix develop --command just build
nix develop --command just publish