Skip to content

Commit

Permalink
add windows release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Jan 18, 2024
1 parent 79f3fdb commit d2aac07
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ common:release-mac --config=release-shared
# Configuration used for release-m1 workflow
common:release-m1 --config=release-shared

# Configuration used for release-windows workflow
common:release-windows --config=release-shared
common:release-windows --config=cache
common:release --remote_instance_name=buildbuddy-io/buildbuddy/release-windows

# Configuration used for Buildbuddy auto-release
common:auto-release --config=remote
common:auto-release --remote_instance_name=buildbuddy-io/buildbuddy/auto-release
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-windows-github-release-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Build Windows Github Release Artifacts"

on:
# Development only
# TODO: remove this
pull_request:
branches:
- master
workflow_dispatch:
inputs:
release_branch:
description: "Git branch to checkout."
required: true
default: "master"
type: string
version_tag:
description: "Version to tag release artifacts."
required: true
type: string
workflow_call:
inputs:
release_branch:
description: "Git branch to checkout."
required: true
type: string
version_tag:
description: "Version to tag release artifacts."
required: true
type: string

jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.release_branch }}
# We need to fetch git tags to obtain the latest version tag to report
# the version of the running binary.
fetch-depth: 0

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-windows-amd64.exe" -o bazel.exe
- name: Build and Upload Artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bazel.exe --output_user_root=D:/0 --windows_enable_symlinks build --config=release-windows --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //enterprise/server/cmd/executor:executor
bazel.exe --output_user_root=D:/0 info
$execution_root = bazel.exe --output_user_root=D:/0 info execution_root
$artifact_rel_path = bazel.exe --output_user_root=D:/0 cquery --output=files //enterprise/server/cmd/executor:executor
$artifact_abs_path = "${execution_root}\${artifact_rel_path}"
Copy-Item -Path $artifact_abs_path -Destination executor-enterprise-windows-amd64.exe
# gh release upload ${{ inputs.version_tag }} executor-enterprise-windows-amd64.exe --clobber

0 comments on commit d2aac07

Please sign in to comment.