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
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ jobs:
name: Build SwiftLint with Bazel
env:
CI_BAZELRC_FILE_CONTENT: ${{ secrets.CI_BAZELRC_FILE_CONTENT }}
- name: Prepare release workspace
run: |
cp bazel-bin/swiftlint .
make bazel_release
mkdir -p bazel-workspace
tar -czvf bazel.tar.gz bazel-workspace
cd bazel-workspace
sed -i '/-warnings-as-errors/d' bazel/copts.bzl
- name: Build release archive
uses: ./.github/actions/bazel-linux-build
env:
CI_BAZELRC_FILE_CONTENT: ${{ secrets.CI_BAZELRC_FILE_CONTENT }}
- name: Run tests for extra rules
run: |
bazel run //:swiftlint -- version
bazel test //Tests/ExtraRulesTests --test_output=errors

plugins_linux:
name: SPM plugins, Linux, Swift ${{ matrix.version }}
Expand Down
17 changes: 8 additions & 9 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -225,25 +225,24 @@ filegroup(
],
)

# TODO: Use rules_pkg
genrule(
name = "release",
srcs = [":release_files"],
outs = [
"bazel.tar.gz",
"bazel.tar.gz.sha256",
],
cmd = """\
set -euo pipefail
cmd = """
set -euo pipefail

outs=($(OUTS))
outs=($(OUTS))

COPYFILE_DISABLE=1 tar czvfh "$${outs[0]}" \
--exclude ^bazel-out/ \
--exclude ^external/ \
*
shasum -a 256 "$${outs[0]}" > "$${outs[1]}"
export COPYFILE_DISABLE=1
tar -czf "$${outs[0]}" --exclude=bazel-out --exclude=external .

"$(location @bazel_tools//tools/build_defs/hash:sha256)" $${outs[0]} $${outs[1]}
""",
tools = ["@bazel_tools//tools/build_defs/hash:sha256"],
)

# Analyze
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bazel_test_tsan:
bazel test --test_output=errors --build_tests_only --features=tsan --test_timeout=1000 //Tests/...

bazel_release: swiftlint
bazel build :release
bazel build :release --verbose_failures
mv -f bazel-bin/bazel.tar.gz bazel-bin/bazel.tar.gz.sha256 .

docker_image:
Expand Down
Loading