Skip to content

add style guide for gemini (#327) #219

add style guide for gemini (#327)

add style guide for gemini (#327) #219

Workflow file for this run

on:
push:
branches: [ main ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# and creating releases.
permissions:
actions: read
pages: write
id-token: write
contents: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "publish"
cancel-in-progress: false
name: Release
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
should-release: ${{ steps.confirm-release.outputs.test }}
branch: ${{ steps.get-branch.outputs.branch }}
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: 10
- name: Get version
id: get-version
run: echo "version=$(cat version)" >> $GITHUB_OUTPUT
- name: Get branch
id: get-branch
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
- name: Confirm release
id: confirm-release
run: echo "test=$(git tag --list 'v${{ steps.get-version.outputs.version }}' | wc -l | sed s/\ //g)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: dotnet restore
# Build the data processing library
- name: Build DataProcessing
run: dotnet build Cognite.DataProcessing/Cognite.DataProcessing.csproj --configuration Release --no-restore -p:PackageVersion=${{ steps.get-version.outputs.version }}
- name: Pack project
run: dotnet pack Cognite.DataProcessing/Cognite.DataProcessing.csproj --output nuget-packages --configuration Release -p:PackageVersion=${{ steps.get-version.outputs.version }} --no-build
# Build the extensions library
- name: Build Extensions
run: dotnet build Cognite.Simulator.Extensions/Cognite.Simulator.Extensions.csproj --configuration Release --no-restore -p:PackageVersion=${{ steps.get-version.outputs.version }}
- name: Pack project
run: dotnet pack Cognite.Simulator.Extensions/Cognite.Simulator.Extensions.csproj --output nuget-packages --configuration Release -p:PackageVersion=${{ steps.get-version.outputs.version }} --no-build
# Build the utils library
- name: Build Utils
run: dotnet build Cognite.Simulator.Utils/Cognite.Simulator.Utils.csproj --configuration Release --no-restore -p:PackageVersion=${{ steps.get-version.outputs.version }}
- name: Pack project
run: dotnet pack Cognite.Simulator.Utils/Cognite.Simulator.Utils.csproj --output nuget-packages --configuration Release -p:PackageVersion=${{ steps.get-version.outputs.version }} --no-build
- name: Package will be released
if: ${{ steps.confirm-release.outputs.test == 0 }}
run: echo "Will release nuget package"
- name: Upload nuget packages
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ steps.get-branch.outputs.branch == 'main' && steps.confirm-release.outputs.test == 0 }}
with:
name: nuget-packages
path: nuget-packages/
retention-days: 1
publish:
name: Create Release
runs-on: windows-latest
environment: CD
if: ${{ needs.build.outputs.branch == 'main' && needs.build.outputs.should-release == 0 }}
needs:
- build
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: 10
- name: Download nuget packages
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: nuget-packages
path: nuget-packages/
- name: Sign nuget packages
env:
CERTIFICATE_HOST: ${{ secrets.CODE_SIGNING_CERT_HOST }}
CERTIFICATE_HOST_API_KEY: ${{ secrets.CODE_SIGNING_CERT_HOST_API_KEY }}
CERTIFICATE_FINGERPRINT: ${{ secrets.CODE_SIGNING_CERT_SHA256_HASH }}
CLIENT_CERTIFICATE: ${{ secrets.CODE_SIGNING_CLIENT_CERT }}
CLIENT_CERTIFICATE_PASSWORD: ${{ secrets.CODE_SIGNING_CLIENT_CERT_PASSWORD }}
KEYPAIR_ALIAS: ${{ secrets.CODE_SIGNING_KEYPAIR_ALIAS }}
uses: cognitedata/code-sign-action/@a29458b69495966f90920f07aeed5acfe03e1f45 # v5
with:
path-to-binary: 'nuget-packages/'
- name: Push nuget packages
run: dotnet nuget push .\nuget-packages\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
continue-on-error: false
- name: Create Release
uses: actions/create-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.build.outputs.version }}
release_name: Release v${{ needs.build.outputs.version }}
draft: false
prerelease: false
publish-docs:
environment:
name: CD
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: 10
- name: Restore docfx
run: dotnet tool restore
working-directory: docfx_project
- name: Build docfx-powered documentation site
run: dotnet tool run docfx ./docfx.json
working-directory: docfx_project
- name: Upload Documentation Pages Artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: 'docfx_project/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4