File tree 9 files changed +96
-14
lines changed
9 files changed +96
-14
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ release-python-apiclient: resolve-earthly
162
162
# ###############################################################################
163
163
.PHONY : release-python-sdk
164
164
release-python-sdk : build-python-sdk
165
- cd python && ${EARTHLY} --push + publish --PYPI_TOKEN= ${PYPI_TOKEN}
165
+ cd python && ${MAKE} publish
166
166
@echo " Python SDK pushed to PyPi."
167
167
168
168
# ###############################################################################
Original file line number Diff line number Diff line change 1
1
2
2
3
3
steps :
4
- - label : " :swagger : Generate Swagger"
5
- command : " ./scripts/generate_swagger.sh"
4
+ - label : " :python : Generate Swagger"
5
+ command : " ./buildkite/ scripts/generate_swagger.sh"
6
6
7
7
- wait : ~
8
8
9
9
- label : " :python: Build Python API Client"
10
- command : " make build-python-apiclient "
10
+ command : " ./buildkite/scripts/build_python_client.sh "
11
11
12
12
- label : " :python: Build Python SDK"
13
- command : " make build-python-sdk "
13
+ command : " ./buildkite/scripts/build_python_sdk.sh "
14
14
15
15
- label : " :python: Build Bacalhau Airflow Integration"
16
16
command : " make build-bacalhau-airflow"
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- make build-python-apiclient
3
+ set -e
4
+
5
+ setup_environment_variables () {
6
+ export PYPI_TOKEN=$( buildkite-agent secret get PYPI_TOKEN)
7
+ export TEST_PYPI_TOKEN=$( buildkite-agent secret get TEST_PYPI_TOKEN)
8
+ export RELEASE_PYTHON_PACKAGES=1
9
+ }
10
+
11
+ download_swagger () {
12
+ cd docs
13
+ rm -rf swagger.json
14
+ buildkite-agent artifact download " swagger.json" . --build $BUILDKITE_BUILD_ID
15
+ cd ..
16
+ }
17
+
18
+ build_python_apiclient () {
19
+ make build-python-apiclient
20
+ }
21
+
22
+ publish_python_apiclient () {
23
+ make release-python-apiclient
24
+ }
25
+
26
+
27
+ main () {
28
+ setup_environment_variables
29
+ download_swagger
30
+ build_python_apiclient
31
+
32
+ if [ -n " $BUILDKITE_TAG " ]; then
33
+ publish_python_apiclient
34
+ fi
35
+ }
36
+
37
+ main
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ setup_environment_variables () {
6
+ export PYPI_TOKEN=$( buildkite-agent secret get PYPI_TOKEN)
7
+ export TEST_PYPI_TOKEN=$( buildkite-agent secret get TEST_PYPI_TOKEN)
8
+ export RELEASE_PYTHON_PACKAGES=1
9
+ }
10
+
11
+ build_python_sdk () {
12
+ make build-python-sdk
13
+ }
14
+
15
+ publish_python_sdk () {
16
+ make release-python-sdk
17
+ }
18
+
19
+ main () {
20
+ setup_environment_variables
21
+ build_python_sdk
22
+
23
+ if [ -n " $BUILDKITE_TAG " ]; then
24
+ publish_python_sdk
25
+ fi
26
+
27
+ }
28
+
29
+ main
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ # Call generate_swagger.sh
5
+ generate_swagger () {
6
+ ./scripts/generate_swagger.sh
7
+ }
8
+
9
+ upload_swagger () {
10
+ cd docs
11
+ buildkite-agent artifact upload " swagger.json"
12
+ }
13
+
14
+ main () {
15
+ generate_swagger
16
+ upload_swagger
17
+ }
18
+
19
+ main
Original file line number Diff line number Diff line change @@ -84,10 +84,9 @@ pypi-upload:
84
84
BUILD +install-twine
85
85
86
86
ARG RELEASE_PYTHON_PACKAGES
87
- LET REPOSITORY_FLAG = "--repository-url https://test.pypi.org/legacy/"
88
87
IF [ "${RELEASE_PYTHON_PACKAGES}" = 1 ]
89
88
RUN echo "Publishing to pypi.org"
90
- RUN REPOSITORY_FLAG = "" # Publish to default repository
89
+ LET REPOSITORY_FLAG = "" # Publish to default repository
91
90
RUN --secret PYPI_TOKEN test -n "${PYPI_TOKEN}" || (echo "PYPI_TOKEN not found" && exit 1)
92
91
RUN --secret PYPI_TOKEN python3 -m twine upload \
93
92
--non-interactive \
@@ -99,6 +98,7 @@ pypi-upload:
99
98
${REPOSITORY_FLAG }
100
99
ELSE
101
100
RUN echo "Publishing to test.pypi.org"
101
+ LET REPOSITORY_FLAG = "--repository-url https://test.pypi.org/legacy/"
102
102
RUN --secret TEST_PYPI_TOKEN test -n "${TEST_PYPI_TOKEN}" || (echo "TEST_PYPI_TOKEN not found" && exit 1)
103
103
RUN --secret TEST_PYPI_TOKEN python3 -m twine upload \
104
104
--non-interactive \
Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ release:
16
16
echo " PYPI_VERSION=$( VERSION) " > .arg
17
17
18
18
# Get PYPI_TOKEN from environment or .env file and push to .secret/ file
19
- python ../scripts/get_pypi_token.py
19
+ python3 ../scripts/get_pypi_token.py
20
20
21
21
$(CP) ${SWAGGER_JSON} ./swagger.json
22
- ${MAKE} clean && ${EARTHLY} +pypi-upload --PACKAGE_NAME=${PACKAGE_NAME} --SWAGGER_JSON=${SWAGGER_JSON} --VERSION=${VERSION}
22
+ ${MAKE} clean && ${EARTHLY} +pypi-upload --PACKAGE_NAME=${PACKAGE_NAME} --SWAGGER_JSON=${SWAGGER_JSON} --VERSION=${VERSION} --RELEASE_PYTHON_PACKAGES=${RELEASE_PYTHON_PACKAGES}
23
23
@echo "Python API client released."
24
24
25
25
.PHONY : all
Original file line number Diff line number Diff line change @@ -61,10 +61,9 @@ publish:
61
61
FROM +install-twine
62
62
BUILD +install-twine
63
63
ARG RELEASE_PYTHON_PACKAGES
64
- LET REPOSITORY_FLAG = "--repository-url https://test.pypi.org/legacy/"
65
64
IF [ "${RELEASE_PYTHON_PACKAGES}" = 1 ]
66
65
RUN echo "Publishing to pypi.org"
67
- RUN REPOSITORY_FLAG = "" # Publish to default repository
66
+ LET REPOSITORY_FLAG = "" # Publish to default repository
68
67
RUN --secret PYPI_TOKEN test -n "${PYPI_TOKEN}" || (echo "PYPI_TOKEN not found" && exit 1)
69
68
RUN --secret PYPI_TOKEN python3 -m twine upload \
70
69
--non-interactive \
@@ -76,6 +75,7 @@ publish:
76
75
${REPOSITORY_FLAG }
77
76
ELSE
78
77
RUN echo "Publishing to test.pypi.org"
78
+ LET REPOSITORY_FLAG = "--repository-url https://test.pypi.org/legacy/"
79
79
RUN --secret TEST_PYPI_TOKEN test -n "${TEST_PYPI_TOKEN}" || (echo "TEST_PYPI_TOKEN not found" && exit 1)
80
80
RUN --secret TEST_PYPI_TOKEN python3 -m twine upload \
81
81
--non-interactive \
Original file line number Diff line number Diff line change @@ -67,6 +67,6 @@ publish:
67
67
echo " PYPI_VERSION=$( VERSION) " > .arg
68
68
69
69
# Get PYPI_TOKEN from environment or .env file and push to .secret/ file
70
- python ../scripts/get_pypi_token.py
70
+ python3 ../scripts/get_pypi_token.py
71
71
72
- $(EARTHLY) --push +publish --PYPI_VERSION=$(VERSION)
72
+ $(EARTHLY) --push +publish --RELEASE_PYTHON_PACKAGES=${RELEASE_PYTHON_PACKAGES} -- PYPI_VERSION=${PYPI_VERSION}
You can’t perform that action at this time.
0 commit comments