-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d2eda5
commit c638e7a
Showing
8 changed files
with
148 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.1.1 | ||
5.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Cut a release whenever a new tag is pushed to the repo. | ||
# You should use an annotated tag, like `git tag -a v1.2.3` | ||
# and put the release notes into the commit message for the tag. | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
USE_BAZEL_VERSION: 5.3.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Mount Bazel cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/bazel | ||
key: bazel-${{ env.USE_BAZEL_VERSION }}-${{ github.sha }} | ||
restore-keys: | | ||
bazel-${{ env.USE_BAZEL_VERSION }}- | ||
bazel- | ||
- name: Setup build tools | ||
run: | | ||
TOOLS_DIR="${HOME}/.cache/tools" | ||
mkdir -p "${TOOLS_DIR}/bin/" | ||
curl -Ls -o "${TOOLS_DIR}/bin/bazel" "https://github.com/bazelbuild/bazelisk/releases/download/v1.14.0/bazelisk-linux-amd64" | ||
chmod +x "${TOOLS_DIR}/bin/bazel" | ||
curl -Ls -o "${TOOLS_DIR}/bin/buildifier" "https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier" | ||
chmod +x "${TOOLS_DIR}/bin/buildifier" | ||
curl -Ls -o "${TOOLS_DIR}/bin/kind" "https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64" | ||
chmod +x "${TOOLS_DIR}/bin/kind" | ||
echo "${TOOLS_DIR}/bin" >> $GITHUB_PATH | ||
- name: Setup kind cluster | ||
run: | | ||
./create_kind_cluster.sh | ||
- name: Build | ||
run: | | ||
bazel build //... | ||
- name: Check | ||
# run downloaded version of buildifier to reduce uncached build times | ||
# see: bazel run //:buildifier-check | ||
run: | | ||
find . -type f \(\ | ||
-name '*.bzl' \ | ||
-o -name '*.sky' \ | ||
-o -name BUILD \ | ||
-o -name BUILD.bazel \ | ||
-o -name WORKSPACE \ | ||
-o -name WORKSPACE.bazel \ | ||
\) | xargs buildifier \ | ||
-mode=check \ | ||
-lint=warn \ | ||
--warnings=-module-docstring,-function-docstring,-function-docstring-header,-function-docstring-args,-function-docstring-return,-print \ | ||
|| { | ||
buildifier_exit_code=$? | ||
echo "Error: failed buildifier checks. Please run \"bazel run //:buildifier-fix\" and commit the changes." | ||
exit $buildifier_exit_code | ||
} | ||
- name: Test | ||
run: | | ||
bazel test //... | ||
- name: Build examples | ||
run: | | ||
cd examples | ||
bazel build //... | ||
- name: Test examples | ||
run: | | ||
cd examples | ||
bazel test //... | ||
- name: E2E | ||
run: | | ||
cd examples | ||
./e2e-test.sh | ||
- name: Prepare workspace snippet | ||
run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: true | ||
# Use GH feature to populate the changelog automatically | ||
generate_release_notes: true | ||
body_path: release_notes.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
TAG=${GITHUB_REF_NAME} | ||
PREFIX="rules_gitops-${TAG:1}" | ||
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}') | ||
|
||
cat << EOF | ||
WORKSPACE snippet: | ||
\`\`\`starlark | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
http_archive( | ||
name = "com_adobe_rules_gitops", | ||
sha256 = "${SHA}", | ||
strip_prefix = "${PREFIX}", | ||
url = ["https://github.com/adobe/rules_gitops/archive/refs/tags/${TAG}.tar.gz"], | ||
) | ||
EOF | ||
|
||
awk '/---SNIP---/{f=1;next}/---END_SNIP---/{f=0}f' examples/WORKSPACE | ||
echo "\`\`\`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.1.1 | ||
5.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters