Skip to content

Commit c0057db

Browse files
Merge pull request #382 from UiPath/fix/ci-publish-pypi
ci: remove reuse workflow for build
2 parents 055c1cc + b953c9a commit c0057db

File tree

2 files changed

+70
-82
lines changed

2 files changed

+70
-82
lines changed

.github/workflows/build.yml

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

.github/workflows/cd.yml

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CD
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
@@ -15,8 +16,72 @@ jobs:
1516
uses: ./.github/workflows/test.yml
1617

1718
build:
18-
needs: [lint, test]
19-
uses: ./.github/workflows/build.yml
20-
secrets:
21-
token: ${{ secrets.PYPI_TOKEN }}
22-
repo_access: ${{ secrets.REPO_ACCESS }}
19+
name: Build
20+
runs-on: ubuntu-latest
21+
22+
needs:
23+
- lint
24+
- test
25+
26+
if: ${{ github.repository == 'UiPath/uipath-python' }}
27+
permissions:
28+
contents: read
29+
actions: write
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup uv
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
enable-cache: true
39+
40+
- name: Setup Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version-file: ".python-version"
44+
45+
- name: Install dependencies
46+
run: uv sync --all-extras
47+
48+
- name: Replace connection string placeholder
49+
run: |
50+
originalfile="src/uipath/telemetry/_constants.py"
51+
tmpfile=$(mktemp)
52+
trap 'rm -f "$tmpfile"' EXIT
53+
54+
rsync -a --no-whole-file --ignore-existing "$originalfile" "$tmpfile"
55+
envsubst '$CONNECTION_STRING' < "$originalfile" > "$tmpfile" && mv "$tmpfile" "$originalfile"
56+
env:
57+
CONNECTION_STRING: ${{ secrets.APPINS_CONNECTION_STRING }}
58+
59+
- name: Build
60+
run: uv build
61+
62+
- name: Upload artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: release-dists
66+
path: dist/
67+
68+
pypi-publish:
69+
name: Upload release to PyPI
70+
runs-on: ubuntu-latest
71+
environment: pypi
72+
73+
needs:
74+
- build
75+
permissions:
76+
contents: read
77+
id-token: write
78+
79+
steps:
80+
- name: Retrieve release distributions
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: release-dists
84+
path: dist/
85+
86+
- name: Publish package distributions to PyPI
87+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)