Skip to content

Commit

Permalink
add ci/build
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jul 4, 2024
1 parent b6f7a67 commit 6d55a41
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
# 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 changes: 4 additions & 0 deletions Speckle.Connectors.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d55a41

Please sign in to comment.