Skip to content

Update python-lib-snapshot #101

Update python-lib-snapshot

Update python-lib-snapshot #101

name: CSharp App Snapshot

Check failure on line 1 in .github/workflows/csharp-app-snapshot.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/csharp-app-snapshot.yml

Invalid workflow file

(Line: 201, Col: 13): Job 'build-docs' depends on unknown job 'build-app'., (Line: 210, Col: 13): Job 'deploy-docs' depends on job 'build-docs' which creates a cycle in the dependency graph.
on:
workflow_call:
inputs:
test_files:
description: 'Test dll output files separated by space.'
required: false
default: ''
type: string
version_file:
description: 'Project file for updating version.'
required: true
type: string
private:
description: 'Calling workflow from a private repo'
required: false
type: boolean
default: true
sourcepath:
description: 'Path to source directory (used for licence check)'
required: false
type: string
default: "src"
product-key:
description: 'Product key used for deploying docs. Should be repo specific. E.g: "python-sdk"'
required: false
default: "productkeynotprovided"
type: string
product-repo:
description: 'Product repository used for downloading snapshot docs'
required: false
default: "productreponotprovided"
type: string
configuration:
description: 'Configuration'
required: false
type: string
default: "Release"
platform:
description: 'Platform'
required: false
type: string
default: "x64"
binary_path:
description: 'Path to the binaries.'
required: false
type: string
default: ""
secrets:
CI_GITHUB_TOKEN:
required: true
NEXUS_USERNAME:
required: false
NEXUS_PASSWORD:
required: false
LC_URL:
required: false
outputs:
version:
description: "The current released version."
value: ${{ jobs.build.outputs.version }}
jobs:
checks:
runs-on: ubuntu-latest
container: zepben/pipeline-basic
outputs:
docs-present: ${{ steps.docs.outputs.present }}
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ env.GITHUB_TOKEN }}
- name: Work around git permission issue
run: |
dname=$(echo ${{github.repository}} | cut -d'/' -f2)
git config --global --add safe.directory /__w/$dname/$dname
shell: sh
- name: Cache licence-check
uses: actions/cache@v4
with:
path: /lc
key: lcc
- name: Check licence
uses: zepben/licence-check-action@main
with:
LC_URL: ${{ secrets.LC_URL }}
PATH: ${{ inputs.sourcepath }}
- name: Check if docs present
id: docs
shell: bash
run: |
if [ -d docs ]; then
echo "Docs folder found, will run the build-docs job"
echo "present=yes" >> "${GITHUB_OUTPUT}"
echo "present=yes" >> "${GITHUB_ENV}"
else
echo "Docs folder not found, will skip the build-docs"
fi
- name: Check doc build artifacts are ignored
if: ${{ env.present == 'yes' }}
shell: sh {0}
run: |
# Make sure directories are properly ignored
# docs/node_modules
git check-ignore -q docs/node_modules
if [ $? != 0 ]; then
echo "ERROR! Make sure to add 'docs/node_modules' to .gitignore"
echo "::error line=1::ERROR! Make sure to add 'docs/node_modules' to .gitignore"
exit 1
fi
# docs/build
git check-ignore -q docs/build
if [ $? != 0 ]; then
echo "ERROR! Make sure to add 'docs/docs' to .gitignore"
echo "::error line=1::ERROR! Make sure to add 'docs/build' to .gitignore"
exit 1
fi
build:
runs-on: windows-2025
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
outputs:
version: ${{ steps.update-info-version.outputs.info_version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Work around git permission issue
run: |
dname=$(echo ${{github.repository}} | cut -d'/' -f2)
git config --global --add safe.directory /__w/$dname/$dname
shell: sh
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Setup MSBuild Path
uses: microsoft/setup-msbuild@v1
- name: Setup VSTest Path
uses: darenm/[email protected]
- name: Update Info version
id: update-info-version
shell: bash
run: |
info_version=$(cat ${{ inputs.version_file }} | grep "AssemblyInformationalVersion(\"[0-9]\+\.[0-9]\+\.[0-9]\+.*\")" | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\++build[0-9]\+")
info_version_date=${info_version#*build}
new_info_version_date=$(date '+%d%m%Y%H%M%S')
sed -i "s|$info_version_date|$new_info_version_date|g" ${{ inputs.version_file }}
info_version=$(cat ${{ inputs.version_file }} | grep "AssemblyInformationalVersion(\"[0-9]\+\.[0-9]\+\.[0-9]\+.*\")" | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\++build[0-9]\+")
echo "info_version=$info_version" >> ${GITHUB_ENV}
artifact_id=$(cat ${{ inputs.version_file }} | grep "AssemblyTitle" | egrep -o "\"[A-Za-z0-9\-]+\"" | tr -d '"')
echo "artifact_id=$artifact_id" >> ${GITHUB_ENV}
- name: Add ZepBen Nuget Repo credentials
run: nuget sources update -Name "ZepBen" -username "${{ secrets.NEXUS_USERNAME }}" -password "${{ secrets.NEXUS_PASSWORD }}" -configFile "Nuget.Config"
- name: Restore NuGet Packages
run:
msbuild /p:Configuration=${{ inputs.configuration }} /p:Platform=${{ inputs.platform }} /t:restore
- name: Build
run: msbuild /p:Configuration=${{ inputs.configuration }} /p:Platform=${{ inputs.platform }}
- name: Test
if: ${{ inputs.test_files != '' }}
run: vstest.console.exe ${{ inputs.test_files }} /Platform:${{ inputs.platform }}
- name: Set upload path
id: upload_path
run: |
if [[ -z $BINARY_PATH ]]; then
echo "path=${{ needs.release-checks.outputs.artifact_id }}/bin/Release/" >> $GITHUB_OUTPUT
else
echo "path=$BINARY_PATH" >> $GITHUB_OUTPUT
fi
env:
BINARY_PATH: ${{ inputs.binary_path }}
shell: bash
- name: Upload Release
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_id }}-${{ env.info_version }}
path: ${{ env.artifact_id }}/bin/Release/
build-docs:
needs: [build-app]
if: ${{ needs.build-app.outputs.docs-present == 'yes' }}
uses: ./.github/workflows/build-docs.yaml
with:
DEPLOY: true
secrets: inherit
deploy-docs:
runs-on: ubuntu-latest
needs: [build-docs]
if: ${{ needs.build-docs.outputs.artifact-uploaded == 'yes' }}
steps:
- name: Deploy documentation
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CI_GITHUB_TOKEN }}
repository: ${{ secrets.DOCS_REPO }}
event-type: ${{ secrets.DOCS_REPO_EVOLVE_WORKFLOW }}
client-payload: '{"product": "${{needs.build-docs.outputs.product}}", "product_key": "${{needs.build-docs.outputs.component}}", "download_url": "${{github.repository}}"}'