File tree 6 files changed +120
-27
lines changed
6 files changed +120
-27
lines changed Original file line number Diff line number Diff line change
1
+ fixedReleaser :
2
+ login : seh
3
+
Original file line number Diff line number Diff line change 1
1
{
2
2
"integrity" : " " ,
3
3
"strip_prefix" : " {REPO}-{VERSION}" ,
4
- "url" : " https://github.com/{OWNER}/{REPO}/archive/refs/tags/ {TAG}.tar.gz"
4
+ "url" : " https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/vcs-archive- {TAG}.tar.gz"
5
5
}
Original file line number Diff line number Diff line change
1
+ name : Build and Test
2
+ description : |
3
+ Build all eligible Bazel targets and run all available
4
+ tests, confirming that they all pass.
5
+ runs :
6
+ using : composite
7
+ steps :
8
+ - name : Cache Bazel-related artifacts
9
+ uses : actions/cache@v3
10
+ env :
11
+ cache-name : bazel-cache
12
+ with :
13
+ path : |
14
+ ~/.cache/bazelisk
15
+ ~/.cache/bazel
16
+ key : ${{ runner.os }}-${{ env.cache-name }}
17
+ - name : Build all Bazel targets
18
+ run : |
19
+ bazel build \
20
+ //...
21
+ shell : bash
22
+ - name : Test all Bazel targets
23
+ run : |
24
+ bazel test \
25
+ --test_output=errors \
26
+ //...
27
+ shell : bash
Original file line number Diff line number Diff line change 1
1
name : Continuous Integration
2
2
on :
3
3
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows.
4
- push :
5
- branches :
6
- - main
7
- tags :
8
- - v*
9
4
pull_request :
10
5
jobs :
11
6
bazel-source-inspection :
12
7
runs-on : ubuntu-latest
13
8
steps :
14
9
- name : Check out VCS repository
15
- uses : actions/checkout@v2
10
+ uses : actions/checkout@v3
16
11
- name : Confirm Bazel files is formatted per "buildifier"
17
12
uses :
thompsonja/[email protected]
18
13
with :
19
14
# See https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md.
20
15
warnings : -function-docstring,-module-docstring
16
+ buildifier_version : 6.1.0
21
17
build-test :
22
18
runs-on : ubuntu-latest
23
19
steps :
24
- - name : Cache bazel-related artifacts
25
- uses : actions/cache@v3
26
- env :
27
- cache-name : bazel-cache
28
- with :
29
- path : |
30
- ~/.cache/bazelisk
31
- ~/.cache/bazel
32
- key : ${{ runner.os }}-${{ env.cache-name }}
33
20
- name : Check out VCS repository
34
21
uses : actions/checkout@v3
35
- - name : Build all Bazel targets
36
- run : |
37
- bazel build \
38
- --enable_bzlmod \
39
- //...
40
- - name : Test all Bazel targets
41
- run : |
42
- bazel test \
43
- --enable_bzlmod \
44
- --test_output=errors \
45
- //...
22
+ - name : Build and test all Bazel targets
23
+ uses : ./.github/actions/build-test
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # This program is adapted from "release_prep.sh" in rules_template:
4
+ # https://github.com/bazel-contrib/rules-template/blob/main/.github/workflows/release_prep.sh
5
+
6
+ set -e -u -o pipefail
7
+
8
+ ruleset_name=" $1 "
9
+ shift
10
+ if [ -z " ${ruleset_name} " ]; then
11
+ echo >&2 ' Bazel ruleset name must not be empty.'
12
+ exit 1
13
+ fi
14
+
15
+ if (( $# < 1 )) ; then
16
+ git_tag=" ${GITHUB_REF_NAME:- } "
17
+ else
18
+ git_tag=" $1 "
19
+ shift
20
+ fi
21
+ if [ -z " ${git_tag} " ]; then
22
+ echo >&2 ' Git tag to use for release must not be empty.'
23
+ exit 1
24
+ fi
25
+
26
+ # The prefix is chosen to match what GitHub generates for its own
27
+ # source archives.
28
+ git archive \
29
+ --format=tar \
30
+ --prefix=" ${ruleset_name} -${git_tag: 1} /" \
31
+ " ${git_tag} " \
32
+ | gzip > " vcs-archive-${git_tag} .tar.gz"
33
+
34
+ tag_annotation_subject=$( git tag --list --format=' %(contents:subject)' " ${git_tag} " )
35
+ if [ -n " ${tag_annotation_subject} " ]; then
36
+ echo " # ${tag_annotation_subject} "
37
+ tag_annotation_body=$( git tag --list --format=' %(contents:body)' " ${git_tag} " )
38
+ if [ -n " ${tag_annotation_body} " ]; then
39
+ echo "
40
+ ${tag_annotation_body}
41
+ "
42
+ fi
43
+ echo " # Details"
44
+ fi
45
+
46
+ cat << EOF
47
+ ## Using modules with Bazel 6 and later
48
+
49
+ 1. Enable support for modules in your _.bazelrc_ file by adding the following line:
50
+ \` common --enable_bzlmod\`
51
+ 1. Add the following directive to your _MODULE.bazel_ file:
52
+ \`\`\` starlark
53
+ bazel_dep(name = "${ruleset_name} ", version = "${git_tag: 1} ")
54
+ \`\`\`
55
+ EOF
Original file line number Diff line number Diff line change
1
+ name : Release
2
+ on :
3
+ # See https://docs.github.com/en/actions/reference/events-that-trigger-workflows.
4
+ push :
5
+ tags :
6
+ - " v*.*.*"
7
+ jobs :
8
+ release :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Check out VCS repository
12
+ uses : actions/checkout@v3
13
+ - name : Build and test all Bazel targets
14
+ uses : ./.github/actions/build-test
15
+ - name : Prepare release notes and artifacts
16
+ run : |
17
+ gh_repository="${{ github.repository }}"
18
+ ref_name="${{ github.ref_name }}"
19
+ tag_name="${ref_name#refs/heads/}"
20
+ .github/workflows/prepare-release \
21
+ "${gh_repository#*/}" \
22
+ "${tag_name}" \
23
+ > release-notes.txt
24
+ - name : Issue release
25
+ uses : softprops/action-gh-release@v1
26
+ with :
27
+ generate_release_notes : true
28
+ body_path : release-notes.txt
29
+ files : vcs-archive-*.tar.gz
30
+ fail_on_unmatched_files : true
You can’t perform that action at this time.
0 commit comments