1- name : Upload Python Package to GCP Artifact Registry
1+ name : Upload Python and JS Packages to GCP Artifact Registry
22
33on :
44 push :
55 branches :
66 - " releases/v*"
77
8-
98jobs :
10- Release :
11- name : Release Workflow
9+ python-release :
10+ name : Python Release
1211 runs-on : ubuntu-latest
1312
1413 permissions :
15- pull-requests : write # write permission is required to create a github release
16- contents : write # allow pushing tags
17- id-token : write # needed for authentication since we are using Workload Identity Federation
14+ pull-requests : write
15+ contents : write
16+ id-token : write
1817
1918 steps :
2019 - name : Checkout repository
@@ -26,53 +25,100 @@ jobs:
2625 # Install a specific version of uv.
2726 version : " 0.7.0"
2827
29- - name : " Set up Python"
28+ - name : Set up Python
3029 uses : actions/setup-python@v5
3130 with :
3231 python-version-file : " pyproject.toml"
33- - run : |
34- make python/dev-install
3532
36- - name : Authenticate to Google Cloud
37- uses : google-github-actions/auth@v2
33+ - run : make python/dev-install
34+
35+ - name : " Shared: Auth + Version Info"
36+ uses : ./.github/actions/shared-setup
3837 with :
3938 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
4039 service_account : ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
40+ version_source : ${{ github.ref }}
41+ target : python
4142
42- - name : Configure gcloud
43+ - name : Configure gcloud for Python
4344 run : |
4445 gcloud config set project qdrant-cloud
45- gcloud config set artifacts/repository python
4646 gcloud config set artifacts/location us
47+ gcloud config set artifacts/repository python
4748
48- - name : Set version in pyproject.toml from branch name
49- run : |
50- VERSION="${GITHUB_REF##*/}" # e.g., v1.1.1
51- STRIPPED_VERSION="${VERSION#v}" # e.g., 1.1.1
52-
53- echo "Detected version: $VERSION"
54- echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
55- echo "PACKAGE_VERSION=$STRIPPED_VERSION" >> $GITHUB_ENV
56-
57- sed -i "s/^version = .*/version = \"$STRIPPED_VERSION\"/" pyproject.toml
58-
59- - name : Build the package
60- run : |
61- uv build
62-
63- - name : Upload to Artifact Registry
49+ - name : Build and upload Python package
6450 run : |
51+ uv build
6552 uv run twine upload \
6653 --repository-url https://us-python.pkg.dev/qdrant-cloud/python/ \
6754 --username oauth2accesstoken \
6855 --password "$(gcloud auth print-access-token)" \
6956 dist/*
70-
57+
58+ js-release :
59+ name : Node.js Release
60+ runs-on : ubuntu-latest
61+
62+ permissions :
63+ pull-requests : write
64+ contents : write
65+ id-token : write
66+
67+ steps :
68+ - name : Checkout repository
69+ uses : actions/checkout@v4
70+
71+ - name : Set up Node.js
72+ uses : actions/setup-node@v4
73+ with :
74+ node-version : " 22"
75+
76+ - name : " Shared: Auth + Version Info"
77+ uses : ./.github/actions/shared-setup
78+ with :
79+ workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
80+ service_account : ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
81+ version_source : ${{ github.ref }}
82+ target : node
83+
84+ - name : Move build output to publish root
85+ run : |
86+ mkdir -p npm_publish
87+ cp -r gen/typescript/* npm_publish/
88+ cp package.example.json npm_publish/package.json
89+ cp .npmrc npm_publish/
90+ cp README.md npm_publish/ || true
91+
92+ - name : Refresh the access token for connecting to the repository
93+ working-directory : npm_publish
94+ run : npm run artifactregistry-login
95+
96+ - name : Publish JS package
97+ working-directory : npm_publish
98+ run : npm publish
99+ finalize-release :
100+ name : Finalize Release
101+ runs-on : ubuntu-latest
102+
103+ needs :
104+ - python-release
105+ - js-release
106+
107+ permissions :
108+ pull-requests : write
109+ contents : write
110+ id-token : write
111+
112+ steps :
113+ - name : Checkout repository
114+ uses : actions/checkout@v4
115+
71116 - name : Tag Release
72- shell : bash
73117 run : |
74- git tag ${{ env.RELEASE_VERSION }}
75- git push origin ${{ env.RELEASE_VERSION }}
118+ VERSION="${GITHUB_REF##*/}" # from 'refs/heads/releases/v1.2.1' → 'v1.2.1'
119+ echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
120+ git tag "$VERSION"
121+ git push origin tag "$VERSION"
76122
77123 - name : Publish Release Notes
78124 uses : release-drafter/release-drafter@v6
82128 tag : ${{ env.RELEASE_VERSION }}
83129 publish : true
84130 env :
85- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments