-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BCR configurations for publishing releases to the central registry (
#1038) Co-authored-by: Corbin McNeely-Smith <58151731+restingbull@users.noreply.github.com>
- Loading branch information
1 parent
55f60ec
commit 11f55e8
Showing
12 changed files
with
136 additions
and
55 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fixedReleaser: | ||
login: Bencodes | ||
email: ben@ben.cm |
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,25 @@ | ||
{ | ||
"homepage": "https://github.com/bazelbuild/rules_kotlin", | ||
"maintainers": [ | ||
{ | ||
"email": "ben@ben.cm", | ||
"github": "Bencodes", | ||
"name": "Ben Lee" | ||
}, | ||
{ | ||
"email": "corbin@mcneely-smith.com", | ||
"github": "restingbull", | ||
"name": "Corbin McNeely-Smith" | ||
}, | ||
{ | ||
"email": "nk@snap.com", | ||
"github": "nkoroste", | ||
"name": "Nick Korostelev" | ||
} | ||
], | ||
"repository": [ | ||
"github:bazelbuild/rules_kotlin" | ||
], | ||
"versions": [], | ||
"yanked_versions": {} | ||
} |
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,12 @@ | ||
matrix: | ||
platform: [ "macos", "ubuntu2004" ] | ||
|
||
tasks: | ||
verify_targets: | ||
name: "Verify build targets" | ||
platform: ${{ platform }} | ||
build_flags: | ||
- "--enable_bzlmod=true" | ||
build_targets: | ||
- "@rules_kotlin//kotlin/..." | ||
- "@rules_kotlin//src/..." |
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,4 @@ | ||
{ | ||
"integrity": "", | ||
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_kotlin-{TAG}.tar.gz" | ||
} |
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,20 @@ | ||
# This file contains Bazel settings to apply on CI only. | ||
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml | ||
common --curses=no | ||
common --enable_bzlmod | ||
|
||
build --verbose_failures | ||
build --worker_verbose | ||
|
||
# Debug where options came from | ||
build --announce_rc | ||
# This directory is configured in GitHub actions to be persisted between runs. | ||
# We do not enable the repository cache to cache downloaded external artifacts | ||
# as these are generally faster to download again than to fetch them from the | ||
# GitHub actions cache. | ||
build --disk_cache=~/.cache/bazel | ||
# Don't rely on test logs being easily accessible from the test runner, | ||
# though it makes the log noisier. | ||
test --test_output=errors | ||
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used | ||
test --test_env=XDG_CACHE_HOME |
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,45 +1,41 @@ | ||
# 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 Binary Package | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
- "v*.*.*" | ||
|
||
jobs: | ||
generate: | ||
name: Create release-artifacts | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the sources" | ||
uses: actions/checkout@v2.3.1 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Mount bazel caches | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/bazel | ||
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod') }} | ||
restore-keys: bazel-cache- | ||
- name: Install JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
- name: Setup Bazelisk | ||
uses: bazelbuild/setup-bazelisk@v1 | ||
- name: Mount bazel cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: "/home/runner/.cache/bazel" | ||
key: caches-${{ runner.os }}-release | ||
- name: Build release artifact | ||
run: bazelisk build //:rules_kotlin_release | ||
- name: Create release sha256 | ||
run: shasum -a 256 bazel-bin/rules_kotlin_release.tgz > bazel-bin/rules_kotlin_release.tgz.sha256 | ||
- name: Upload bazel-bin/rules_kotlin_release.tgz | ||
uses: svenstaro/upload-release-action@2.2.1 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: bazel-bin/rules_kotlin_release.tgz | ||
asset_name: rules_kotlin_release.tgz | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
- name: Upload bazel-bin/rules_kotlin_release.tgz.sha256 | ||
uses: svenstaro/upload-release-action@2.2.1 | ||
- name: Prepare release notes and artifacts | ||
env: | ||
# Bazelisk will download bazel to here. | ||
XDG_CACHE_HOME: ~/.cache/bazel-repo | ||
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: bazel-bin/rules_kotlin_release.tgz.sha256 | ||
asset_name: rules_kotlin_release.tgz.sha256 | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
prerelease: true | ||
# Use GH feature to populate the changelog automatically | ||
generate_release_notes: true | ||
body_path: release_notes.txt | ||
fail_on_unmatched_files: true | ||
files: rules_kotlin-*.tar.gz |
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
# Set by GH actions, see | ||
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables | ||
TAG=${GITHUB_REF_NAME} | ||
# The prefix is chosen to match what GitHub generates for source archives | ||
PREFIX="rules_kotlin-${TAG:1}" | ||
ARCHIVE="rules_kotlin-$TAG.tar.gz" | ||
bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc build //:rules_kotlin_release | ||
cp bazel-bin/rules_kotlin_release.tgz $ARCHIVE | ||
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') | ||
|
||
cat << EOF | ||
## Using Bzlmod with Bazel 6 | ||
1. Enable with \`common --enable_bzlmod\` in \`.bazelrc\`. | ||
2. Add to your \`MODULE.bazel\` file: | ||
\`\`\`starlark | ||
bazel_dep(name = "rules_kotlin", version = "${TAG:1}") | ||
\`\`\` | ||
## Using WORKSPACE | ||
Paste this snippet into your `WORKSPACE.bazel` file: | ||
\`\`\`starlark | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
http_archive( | ||
name = "rules_kotlin", | ||
sha256 = "${SHA}", | ||
strip_prefix = "${PREFIX}", | ||
url = "https://github.com/buildfoundation/rules_kotlin/releases/download/${TAG}/${ARCHIVE}", | ||
) | ||
EOF | ||
|
||
echo "\`\`\`" |
Validating CODEOWNERS rules …
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 @@ | ||
* @ahumesky @cgruber @djwhang @timpeut @restingbull | ||
* @ahumesky @cgruber @restingbull @Bencodes @nkoroste |
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,7 +1 @@ | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
load("@rules_android//android:rules.bzl", "android_sdk_repository") | ||
|
||
maybe( | ||
android_sdk_repository, | ||
name = "androidsdk", | ||
) | ||
android_sdk_repository(name = "androidsdk") |
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