Skip to content

Bump the dotnet group with 8 updates #14

Bump the dotnet group with 8 updates

Bump the dotnet group with 8 updates #14

Workflow file for this run

name: release
on:
push:
tags: [ v*.*.* ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
BUILD_PATH: bin
PUBLISH_PATH: publish
BUILD_CONFIGURATION: ${{ startsWith(github.ref, 'refs/tags/') && 'Release' || 'Debug' }}
permissions:
contents: write
packages: write
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c ${{ env.BUILD_CONFIGURATION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Test
run: dotnet test --no-build -c ${{ env.BUILD_CONFIGURATION }} --results-directory TestResults/ -- --maximum-parallel-tests 4
- name: Upload Test Results
uses: actions/upload-artifact@v7
with:
name: test-results
path: TestResults/**
publish:
needs: [ tests ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
dotnet build "./src/Telemetry.Api/Telemetry.Api.csproj" -c $BUILD_CONFIGURATION -o $BUILD_PATH
dotnet build "./src/Telemetry.Migrations.Oracle/Telemetry.Migrations.Oracle.csproj" -c $BUILD_CONFIGURATION -o $BUILD_PATH
dotnet build "./src/Telemetry.Migrations.Postgres/Telemetry.Migrations.Postgres.csproj" -c $BUILD_CONFIGURATION -o $BUILD_PATH
dotnet build "./src/Telemetry.Migrations.Sqlite/Telemetry.Migrations.Sqlite.csproj" -c $BUILD_CONFIGURATION -o $BUILD_PATH
dotnet build "./src/Telemetry.Migrations.SqlServer/Telemetry.Migrations.SqlServer.csproj" -c $BUILD_CONFIGURATION -o $BUILD_PATH
- name: Publish
run: |
dotnet publish "./src/Telemetry.Api/Telemetry.Api.csproj" -c $BUILD_CONFIGURATION -o $PUBLISH_PATH
dotnet publish "./src/Telemetry.Migrations.Oracle/Telemetry.Migrations.Oracle.csproj" -c $BUILD_CONFIGURATION -o $PUBLISH_PATH
dotnet publish "./src/Telemetry.Migrations.Postgres/Telemetry.Migrations.Postgres.csproj" -c $BUILD_CONFIGURATION -o $PUBLISH_PATH
dotnet publish "./src/Telemetry.Migrations.Sqlite/Telemetry.Migrations.Sqlite.csproj" -c $BUILD_CONFIGURATION -o $PUBLISH_PATH
dotnet publish "./src/Telemetry.Migrations.SqlServer/Telemetry.Migrations.SqlServer.csproj" -c $BUILD_CONFIGURATION -o $PUBLISH_PATH
- name: Upload Publish Results
uses: actions/upload-artifact@v7
with:
name: publish
path: |
${{ env.PUBLISH_PATH }}/**
app-release:
needs: [ publish ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v8
with:
name: publish
path: ${{ env.PUBLISH_PATH }}
- name: Set version
id: vars
run: |
VERSION=${GITHUB_REF_NAME}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create zip
run: |
cd ${{ env.PUBLISH_PATH }}
zip -r ../telemetry-server-${{ steps.vars.outputs.version }}.zip .
- name: Generate checksum
run: |
sha256sum telemetry-server-${{ steps.vars.outputs.version }}.zip > checksums.txt
- name: Generate metadata
run: |
cat <<EOF > build-info.json
{
"version": "${{ steps.vars.outputs.version }}",
"commit": "${GITHUB_SHA}",
"ref": "${GITHUB_REF}",
"run_id": "${GITHUB_RUN_ID}",
"built_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
}
EOF
- name: Publish Release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
generate_release_notes: true
files: |
telemetry-server-${{ steps.vars.outputs.version }}.zip
checksums.txt
build-info.json
docker:
needs: [ tests ]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
if: startsWith(github.ref, 'refs/tags/')
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
type=sha,prefix=
labels: |
org.opencontainers.image.authors=${{ github.repository_owner }}, Biseuv Olzhas (dosymep)
org.opencontainers.image.licenses=GPL-3.0
org.opencontainers.image.description=A high-performance .NET 10 Web API service designed to collect and store telemetry data from pyRevit.
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build image (verify only)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v7
with:
platforms: linux/amd64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: src/Telemetry.Api/Dockerfile
tags: ghcr.io/${{ github.repository }}:ci-check
build-args: |
VERSION=${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}
- name: Build and push
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v7
with:
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
context: .
file: src/Telemetry.Api/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args: |
VERSION=${{ steps.meta.outputs.version }}