Skip to content

Merge branch 'dev' into installer-test/adam/cnx-1367-build-subset-whe… #162

Merge branch 'dev' into installer-test/adam/cnx-1367-build-subset-whe…

Merge branch 'dev' into installer-test/adam/cnx-1367-build-subset-whe… #162

Workflow file for this run

name: .NET Build and Publish
on:
push:
branches: ["main", "installer-test/**"]
tags: ["v3.*"] # Manual delivery on every 3.x tag
jobs:
build-windows:
runs-on: windows-latest
env:
SPECKLE_VERSION: "unset"
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.4xx # 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 on Windows
run: ./build.ps1 zip
- name: ⬆️ Upload artifacts
#if tag and it's main branch (or installer-test branch)
if: (github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v3.') && github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/installer-test/')
uses: actions/upload-artifact@v4
with:
name: output-${{ env.SPECKLE_VERSION }}
path: output/*.*
if-no-files-found: error
retention-days: 1
compression-level: 0 # no compression
- id: set-version
name: Set version to output
run: echo "version=${{ env.SPECKLE_VERSION }}" >> "$Env:GITHUB_OUTPUT"
deploy-installers:
runs-on: ubuntu-latest
needs: build-windows
#if tag and it's main branch (or installer-test branch)
if: (github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v3.') && github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/installer-test/')
env:
IS_RELEASE_BRANCH: ${{ github.ref == 'refs/heads/main' }}
IS_TEST_INSTALLER: ${{ startsWith(github.ref, 'refs/heads/installer-test/') }}
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-windows.outputs.version }}", "public_release": ${{ env.IS_RELEASE_BRANCH }}, "store_artifacts": ${{ env.IS_TEST_INSTALLER }} }'
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-*
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.4xx # 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 tests on Linux
run: ./build.sh test-only
- name: ⚒️ Run Build and Pack on Linux
run: ./build.sh build-linux
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
files: Converters/**/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Push to nuget.org
#if tag and it's main branch (or installer-test branch)
if: (github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v3.') && github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/installer-test/')
run: dotnet nuget push output/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.CONNECTORS_NUGET_TOKEN }} --skip-duplicate