Merge pull request #383 from specklesystems/dev #549
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Build and Publish | |
on: | |
push: | |
branches: ["main", "dev", "release/*"] # Continuous delivery on every long-lived branch | |
tags: ["v3.*"] # Manual delivery on every 3.x tag | |
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') }} | |
- 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 }}" >> "$Env:GITHUB_OUTPUT" | |
deploy-installers: | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
IS_TAG_BUILD: ${{ github.ref_type == 'tag' }} | |
IS_RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'main'}} | |
steps: | |
- name: 🔫 Trigger Build Installers | |
uses: ALEEF02/workflow-dispatch@v3.0.0 | |
continue-on-error: true | |
with: | |
workflow: Build Installers | |
repo: specklesystems/connector-installers | |
token: ${{ secrets.CONNECTORS_GH_TOKEN }} | |
inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build.outputs.version }}", "public_release": ${{ env.IS_TAG_BUILD }}, "store_artifacts": ${{ env.IS_RELEASE_BRANCH }} }' | |
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 | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: output-* | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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') }} | |
- name: ⚒️ Run build | |
run: ./build.sh test-only | |
- name: Upload coverage reports to Codecov with GitHub Action | |
uses: codecov/codecov-action@v4 | |
with: | |
file: Converters/**/coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |