Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
set -euo pipefail

cd "${KOKORO_ARTIFACTS_DIR}/git/serverless/functions-framework-python"

### Set up Airlock for Bookworm
rm -f /etc/apt/sources.list.d/* /etc/apt/sources.list
echo 'deb https://us-apt.pkg.dev/remote/artifact-foundry-prod/debian-3p-remote-bookworm bookworm main' | \
tee -a /etc/apt/sources.list.d/artifact-registry.list

# Set up Airlock for Python
cat > "$HOME/.pypirc" <<EOF
[distutils]
index-servers =
python-3p-trusted

[python-3p-trusted]
repository = https://us-python.pkg.dev/artifact-foundry-prod/python-3p-trusted/
EOF

mkdir -p "$HOME/.pip"
cat > "$HOME/.pip/pip.conf" <<EOF
[global]
index-url = https://us-python.pkg.dev/artifact-foundry-prod/python-3p-trusted/simple/
EOF

### Install dependencies
pip install \
--only-binary :all: \
--require-hashes \
--no-deps \
-r .kokoro/requirements/build.txt \
--verbose # shows it is pulling from Airlock

### Build and Publish
artifacts_dir="$KOKORO_ARTIFACTS_DIR/artifacts/"
mkdir -p "${artifacts_dir}"

readarray -t pkgs < <(find -name "pyproject.toml" -or -name "setup.py")
for pkg in "${pkgs[@]}"; do
pkg="$(dirname "${pkg}")"
python3 -m build --wheel "${pkg}" --outdir "${artifacts_dir}"
done

twine upload \
--repository-url "https://us-python.pkg.dev/oss-exit-gate-prod/ff-releases--pypi" \
--verbose \
"${artifacts_dir}/*"
10 changes: 10 additions & 0 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail

cd "${KOKORO_ARTIFACTS_DIR}"

cat > manifest.json <<'EOF'
{
"publish_all": true
}
EOF
6 changes: 6 additions & 0 deletions .kokoro/requirements/build.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--only-binary :all:
twine>=6.2.0
build>=1.3.0
wheel>=0.45.1
keyring>=25.7.0
keyrings.google-artifactregistry-auth>=1.1.2
Loading
Loading