-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (97 loc) · 3.06 KB
/
Copy pathrelease-ducpy.yml
File metadata and controls
106 lines (97 loc) · 3.06 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release Python
on:
workflow_dispatch:
push:
branches:
- main
- next
- dev
paths:
- 'packages/ducpy/**'
- 'package.json'
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release_ducpy:
runs-on: ubuntu-latest
concurrency:
group: release-ducpy
cancel-in-progress: false
outputs:
release_status: ${{ steps.release.outputs.status }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
persist-credentials: true
- name: Set Git User
run: |
git config user.name "GitHub Action"
git config user.email "action@github.com"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install Monorepo Dependencies
run: bun install
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Setup release environment
id: setup-release-environment
uses: ./.github/actions/simulate-main-environment
with:
current-branch: ${{ github.ref_name }}
package-name: ducpy
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
if bunx semantic-release ${{ steps.setup-release-environment.outputs.release-mode }}; then
echo "status=success" >> $GITHUB_OUTPUT
else
echo "status=failure" >> $GITHUB_OUTPUT
exit 1
fi
working-directory: ./packages/ducpy
- name: Upload wheels to GitHub release
if: steps.release.outputs.status == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the tag created by semantic-release
TAG=$(git describe --tags --abbrev=0)
echo "Uploading wheels from dist/ to release $TAG"
# Upload all wheels and source distributions
find packages/ducpy/dist -name "*.whl" -o -name "*.tar.gz" | while read file; do
echo "Uploading: $file"
gh release upload "$TAG" "$file" --clobber
done
- name: Deploy Python documentation
if: steps.release.outputs.status == 'success'
uses: peter-evans/repository-dispatch@v3
with:
event-type: trigger-ducpy-docs-deployment
token: ${{ secrets.GITHUB_TOKEN }}
- name: Notify web deployment
if: steps.release.outputs.status == 'success'
uses: peter-evans/repository-dispatch@v3
with:
event-type: trigger-web-deployment
token: ${{ secrets.GITHUB_TOKEN }}
client-payload: |
{"source": "release-ducpy", "web_changed": "false", "success": "true"}