From 9b97b64fc1d6e35a7d39e3ab3bf2afbbe2329ba4 Mon Sep 17 00:00:00 2001 From: Maxwell Elliott <56700854+tinder-maxwellelliott@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:23:41 -0400 Subject: [PATCH] Upload BCR friendly archives (#233) * Upload BCR friendly archives GH archives cannot be trusted to be stable * more updates * update * keep sha version --- .github/workflows/ci.yaml | 33 ++++++++++++++++++++------------- .gitignore | 1 + Makefile | 9 +++++++++ 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d50b18d3..de2cf52e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,55 +11,55 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' - name: Setup Go environment - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ^1.17 id: go - name: Setup Bazelisk run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run bazel-diff tests run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true test-jre11: runs-on: ubuntu-latest steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' - name: Setup Go environment - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ^1.17 id: go - name: Setup Bazelisk run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run bazel-diff tests run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=false test-jre11-run-example: runs-on: ubuntu-latest steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '11' id: java - name: Setup Go environment - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ^1.17 id: go - name: Setup Bazelisk run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Run bazel-diff example script @@ -72,23 +72,30 @@ jobs: java: [ '11' ] steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: ${{ matrix.java }} id: java - name: Setup Go environment - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ^1.17 id: go - name: Setup Bazelisk run: go install github.com/bazelbuild/bazelisk@latest && export PATH=$PATH:$(go env GOPATH)/bin - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build deployable JAR run: ~/go/bin/bazelisk build //cli:bazel-diff_deploy.jar - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: bazel-diff_deploy.jar path: bazel-bin/cli/bazel-diff_deploy.jar if-no-files-found: error + - name: Build release source archive + run: make release_source_archive + - uses: actions/upload-artifact@v4 + with: + name: release_source_archive + path: archives/ + if-no-files-found: error diff --git a/.gitignore b/.gitignore index 6185651b..1e6cb1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ user.bazelrc !bazel-diff-example.sh .DS_Store !.bazelversion +archives/ diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..a4d884d9 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: release_source_archive +release_source_archive: version ?= $$(git describe --tags --abbrev=0 2>/dev/null || git rev-parse HEAD) +release_source_archive: + mkdir -p archives + tar --exclude-vcs \ + --exclude=bazel-* \ + --exclude=.github \ + --exclude=archives \ + -zcf "archives/bazel_diff_$(version).tar.gz" .