mirror of
https://github.com/bitwarden/self-host.git
synced 2026-06-27 22:05:45 +00:00
106 lines
2.9 KiB
YAML
106 lines
2.9 KiB
YAML
name: Build bwsh CLI
|
|
|
|
run-name: Build bwsh CLI ${{ github.event_name }}
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "POC/bwsh/**"
|
|
- "POC/bwsh.Test/**"
|
|
- ".github/workflows/build-bwsh.yml"
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
paths:
|
|
- "POC/bwsh/**"
|
|
- "POC/bwsh.Test/**"
|
|
- ".github/workflows/build-bwsh.yml"
|
|
workflow_dispatch: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
test:
|
|
name: Lint and test
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
|
|
with:
|
|
dotnet-version: "10.0.x"
|
|
|
|
- name: Check formatting
|
|
run: |
|
|
dotnet format POC/bwsh/Bwsh.csproj --verify-no-changes
|
|
dotnet format POC/bwsh.Test/Bwsh.Test.csproj --verify-no-changes
|
|
|
|
- name: Run unit tests
|
|
working-directory: POC/bwsh.Test
|
|
run: dotnet test --configuration Release
|
|
|
|
build:
|
|
name: Build (${{ matrix.rid }})
|
|
needs: test
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- rid: linux-x64
|
|
runner: ubuntu-24.04
|
|
- rid: linux-arm64
|
|
runner: ubuntu-24.04
|
|
- rid: win-x64
|
|
runner: ubuntu-24.04
|
|
- rid: osx-x64
|
|
runner: macos-14
|
|
- rid: osx-arm64
|
|
runner: macos-14
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
|
|
with:
|
|
dotnet-version: "10.0.x"
|
|
|
|
- name: Publish self-contained binary
|
|
working-directory: POC/bwsh
|
|
env:
|
|
RID: ${{ matrix.rid }}
|
|
run: |
|
|
dotnet publish Bwsh.csproj \
|
|
--configuration Release \
|
|
--runtime "$RID" \
|
|
--self-contained true \
|
|
-p:PublishSingleFile=true \
|
|
-p:IncludeNativeLibrariesForSelfExtract=true \
|
|
-p:EnableCompressionInSingleFile=true \
|
|
-p:DebugType=none \
|
|
--output "publish/$RID"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: bwsh-${{ matrix.rid }}
|
|
path: |
|
|
POC/bwsh/publish/${{ matrix.rid }}/bwsh
|
|
POC/bwsh/publish/${{ matrix.rid }}/bwsh.exe
|
|
if-no-files-found: error |