Skip to content

build: update rules_rust 0.49.3 -> 0.54.1 #111

build: update rules_rust 0.49.3 -> 0.54.1

build: update rules_rust 0.49.3 -> 0.54.1 #111

Workflow file for this run

name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build-and-test:
name: Build and Test
runs-on: ${{ matrix.target.runs-on }}
strategy:
matrix:
target:
- name: linux-amd64
runs-on: ubuntu-20.04
extension: ""
# - name: windows-amd64
# runs-on: windows-2019
# extension: .exe
- name: osx-amd64
runs-on: macos-13
extension: ""
- name: osx-arm64
runs-on: macos-14
extension: ""
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up bazelrc
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
echo "build:ci --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" >> ~/.bazelrc
echo "startup --output_base=$RUNNER_TEMP/.bazel/output_base" >> ~/.bazelrc
- uses: actions/cache@v4
with:
path: |
${{ runner.temp }}/.bazel/output_base/external
key: bazel-${{ matrix.target.name }}-${{ github.ref }}
restore-keys:
bazel-${{ matrix.target.name }}-refs/heads/master
- name: Build & Test
run: |
INVOCATION_ID="$(uuidgen)"
echo "[View on BuildBuddy](https://bazel-lsp.buildbuddy.io/invocation/$INVOCATION_ID)" >> $GITHUB_STEP_SUMMARY
bazel test //... -c opt --config=ci --invocation_id="$INVOCATION_ID"
- uses: actions/upload-artifact@v4
with:
name: bazel-lsp-${{ matrix.target.name }}${{ matrix.target.extension }}
path: bazel-bin/bazel-lsp${{ matrix.target.extension }}
release:
name: Release
needs: [build-and-test]
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: rust
if: github.ref == 'refs/heads/master'
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: releases
pattern: bazel-lsp-*
- name: Rename artifacts
run: |
version=${{ steps.release.outputs.major || 0 }}.${{ steps.release.outputs.minor || 0 }}.${{ steps.release.outputs.patch || 0 }}
files="$(find releases -type f)"
for file in $files; do
basename="$(basename $file)"
extension="${basename/bazel-lsp/}"
dirname="$(dirname $file)"
mv "$file" "${dirname/bazel-lsp-/bazel-lsp-${version}-}${extension}"
rmdir "$dirname"
done
- name: Show Release Artifacts
run: find releases
- name: Upload Release Artifacts
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
run: gh release upload ${{ steps.release.outputs.tag_name }} ./releases/*