1- name : Upload Python Package to GCP Artifact Registry
1+ name : Upload Python and JS Packages to GCP Artifact Registry
22
3+ # on:
4+ # push:
5+ # branches:
6+ # - "releases/v*"
37on :
48 push :
59 branches :
6- - " releases/v*"
7-
10+ - " **"
811
912jobs :
10- Release :
11- name : Release Workflow
13+ # todo mikheil: uncomment me
14+ # python-release:
15+ # name: Python Release
16+ # runs-on: ubuntu-latest
17+ #
18+ # permissions:
19+ # pull-requests: write
20+ # contents: write
21+ # id-token: write
22+ #
23+ # steps:
24+ # - name: Checkout repository
25+ # uses: actions/checkout@v4
26+ #
27+ # - name: Install uv
28+ # uses: astral-sh/setup-uv@v5
29+ # with:
30+ # # Install a specific version of uv.
31+ # version: "0.7.0"
32+ #
33+ # - name: Set up Python
34+ # uses: actions/setup-python@v5
35+ # with:
36+ # python-version-file: "pyproject.toml"
37+ #
38+ # - run: make python/dev-install
39+ #
40+ # - name: Authenticate to Google Cloud
41+ # uses: google-github-actions/auth@v2
42+ # with:
43+ # workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
44+ # service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
45+ #
46+ # - name: Configure gcloud for Python
47+ # run: |
48+ # gcloud config set project qdrant-cloud
49+ # gcloud config set artifacts/location us
50+ # gcloud config set artifacts/repository python
51+ #
52+ # - name: Set Python version from branch name
53+ # run: |
54+ # VERSION="${GITHUB_REF##*/}"
55+ # STRIPPED_VERSION="${VERSION#v}"
56+ #
57+ # echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
58+ # echo "PACKAGE_VERSION=$STRIPPED_VERSION" >> $GITHUB_ENV
59+ #
60+ # sed -i "s/^version = .*/version = \"$STRIPPED_VERSION\"/" pyproject.toml
61+ #
62+ # - name: Build and upload Python package
63+ # run: |
64+ # uv build
65+ # uv run twine upload \
66+ # --repository-url https://us-python.pkg.dev/qdrant-cloud/python/ \
67+ # --username oauth2accesstoken \
68+ # --password "$(gcloud auth print-access-token)" \
69+ # dist/*
70+ # - name: Tag Release
71+ # run: |
72+ # git tag ${{ env.RELEASE_VERSION }}
73+ # git push origin ${{ env.RELEASE_VERSION }}
74+ #
75+ # - name: Publish Release Notes
76+ # uses: release-drafter/release-drafter@v6
77+ # with:
78+ # disable-autolabeler: true
79+ # commitish: ${{ github.ref }}
80+ # tag: ${{ env.RELEASE_VERSION }}
81+ # publish: true
82+ # env:
83+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
85+ js-release :
86+ name : Node.js Release
1287 runs-on : ubuntu-latest
1388
1489 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
90+ pull-requests : write
91+ contents : write
92+ id-token : write
1893
1994 steps :
2095 - name : Checkout repository
2196 uses : actions/checkout@v4
2297
23- - name : Install uv
24- uses : astral-sh /setup-uv@v5
98+ - name : Set up Node.js
99+ uses : actions /setup-node@v4
25100 with :
26- # Install a specific version of uv.
27- version : " 0.7.0"
101+ node-version : " 20"
28102
29- - name : " Set up Python"
30- uses : actions/setup-python@v5
31- with :
32- python-version-file : " pyproject.toml"
33- - run : |
34- make python/dev-install
103+ - name : Install dependencies
104+ run : npm ci
35105
36106 - name : Authenticate to Google Cloud
37107 uses : google-github-actions/auth@v2
38108 with :
39109 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
40110 service_account : ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
41111
42- - name : Configure gcloud
112+ - name : Set JS version from branch name
43113 run : |
44- gcloud config set project qdrant-cloud
45- gcloud config set artifacts/repository python
46- gcloud config set artifacts/location us
114+ VERSION="${GITHUB_REF##*/}"
115+ STRIPPED_VERSION="${VERSION#v}"
47116
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"
54117 echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
55118 echo "PACKAGE_VERSION=$STRIPPED_VERSION" >> $GITHUB_ENV
56-
57- sed -i "s/^version = .*/version = \"$STRIPPED_VERSION\"/" pyproject.toml
58119
59- - name : Build the package
60- run : |
61- uv build
120+ jq --arg version "0.0.1" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json
62121
63- - name : Upload to Artifact Registry
64- run : |
65- uv run twine upload \
66- --repository-url https://us-python.pkg.dev/qdrant-cloud/python/ \
67- --username oauth2accesstoken \
68- --password "$(gcloud auth print-access-token)" \
69- dist/*
70-
71- - name : Tag Release
72- shell : bash
122+ - name : Configure npm for GCP Artifact Registry
73123 run : |
74- git tag ${{ env.RELEASE_VERSION }}
75- git push origin ${{ env.RELEASE_VERSION }}
124+ echo "@qdrant:registry=https://us-npm.pkg.dev/qdrant-cloud/npm/" > .npmrc
125+ echo "//us-npm.pkg.dev/qdrant-cloud/npm/:always-auth=true" >> .npmrc
76126
77- - name : Publish Release Notes
78- uses : release-drafter/release-drafter@v6
79- with :
80- disable-autolabeler : true
81- commitish : ${{ github.ref }}
82- tag : ${{ env.RELEASE_VERSION }}
83- publish : true
84- env :
85- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
127+ - name : Refresh the access token for connecting to the repository
128+ run : npm run artifactregistry-login
129+
130+ - name : Publish JS package to Artifact Registry
131+ run : npm publish
0 commit comments