Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/cloud_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,40 @@ jobs:
shell: bash
run: |
export TAG_NAME="${REF#*/tags/}"
export ARTIFACTS_DIR="$(pwd)/artifacts"
mkdir -p "${ARTIFACTS_DIR}"
./ci/save_version_info.sh
./ci/cloud_build_release.sh -p
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: cloud-artifacts
path: artifacts/
create-github-release:
if: ${{ contains(github.event.ref, '-') }}
name: Create Release on Github
runs-on: ubuntu-latest
needs: build-release
permissions:
contents: write
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: Create Release
env:
REF: ${{ github.event.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: pixie-io
REPO: pixie
shell: bash
# yamllint disable rule:indentation
run: |
export TAG_NAME="${REF#*/tags/}"
# actions/checkout doesn't get the tag annotation properly.
git fetch origin tag "${TAG_NAME}" -f
export changelog="$(git tag -l --format='%(contents)' "${TAG_NAME}")"
gh release create "${TAG_NAME}" --title "Cloud ${TAG_NAME#release/cloud/}" \
--notes $'Pixie Cloud Release:\n'"${changelog}"
gh release upload "${TAG_NAME}" cloud-artifacts/*
# yamllint enable rule:indentation
8 changes: 7 additions & 1 deletion ci/cloud_build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ parse_args() {

parse_args "$@"

artifacts_dir="${ARTIFACTS_DIR:?}"

repo_path=$(pwd)

release_tag=${TAG_NAME##*/v}
Expand All @@ -53,7 +55,7 @@ if [[ "$PUBLIC" == "true" ]]; then
bazel run --config=stamp -c opt --action_env=GOOGLE_APPLICATION_CREDENTIALS --//k8s:image_version="${release_tag}" \
--//k8s:build_type=public //k8s/cloud:cloud_images_push

all_licenses_opts=("//tools/licenses:all_licenses" "--action_env=GOOGLE_APPLICATION_CREDENTIALS")
all_licenses_opts=("//tools/licenses:all_licenses" "--action_env=GOOGLE_APPLICATION_CREDENTIALS" "--remote_download_outputs=toplevel")
all_licenses_path="$(bazel cquery "${all_licenses_opts[@]}" --output starlark --starlark:expr "target.files.to_list()[0].path" 2> /dev/null)"
bazel build "${all_licenses_opts[@]}"

Expand Down Expand Up @@ -85,6 +87,10 @@ if [[ "$PUBLIC" == "true" ]]; then
gsutil cp "${repo_path}/pixie_cloud.tar.gz" "gs://pixie-dev-public/cloud/latest/pixie_cloud.tar.gz"
fi

sha256sum "${repo_path}/pixie_cloud.tar.gz" | awk '{print $1}' > sha
cp "${repo_path}/pixie_cloud.tar.gz" "${artifacts_dir}/pixie_cloud.tar.gz"
cp sha "${artifacts_dir}/pixie_cloud.tar.gz.sha256"

exit 0
fi

Expand Down