add ci/build

This commit is contained in:
Adam Hathcock
2024-07-04 12:26:30 +01:00
parent b6f7a677f4
commit 6d55a418f8
3 changed files with 86 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
name: .NET Build
on:
pull_request: # Run build on every pull request that is not to main/dev
branches-ignore:
- main
- dev
workflow_call:
outputs:
version:
value: ${{ jobs.build.outputs.version }}
jobs:
build:
runs-on: windows-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.2xx # Align with global.json (including roll forward rules)
- name: Cache Nuget
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: ⚒️ Run GitVersion
run: ./build.ps1 build-server-version
- name: ⚒️ Run build
run: ./build.ps1
- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{ env.GitVersion_FullSemVer }}
path: output/*.*
compression-level: 0 # no compression
- id: set-version
name: Set version to output
run: echo "version=${{ env.GitVersion_FullSemVer }}" >> "$GITHUB_OUTPUT"
+30
View File
@@ -0,0 +1,30 @@
name: .NET Build and Publish
on:
push:
branches: ["main", "dev"] # Continuous delivery on every long-lived branch
tags: ["3.*"] # Manual delivery on every 3.x tag
pull_request:
branches: ["main", "dev"] # Releases on every PR that targets main or dev
jobs:
build:
uses: ./.github/workflows/ci.yml
# deploy-installers:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: 🔫 Trigger Build Installers
# uses: ALEEF02/workflow-dispatch@v3.0.0
# with:
# workflow: Build Installers
# repo: specklesystems/connector-installers
# token: ${{ secrets.CONNECTORS_GH_TOKEN }}
# inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build.outputs.version }}" }'
# ref: main
# wait-for-completion: true
# wait-for-completion-interval: 10s
# wait-for-completion-timeout: 10m
# display-workflow-run-url: true
# display-workflow-run-url-interval: 10s
+4
View File
@@ -74,6 +74,10 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HostApps", "HostApps", "{42826721-9A18-4762-8BA9-F1429DD5C5B1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{59E8E8F3-4E42-4E92-83B3-B1C2AB901D18}"
ProjectSection(SolutionItems) = preProject
.github\workflows\main.yml = .github\workflows\main.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution