DepthAI Demo CI/CD #950
This file contains hidden or 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: DepthAI Demo CI/CD | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| - '!v*-sdk' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| windows-installer: | |
| runs-on: ['self-hosted', 'win-signing-runner'] | |
| steps: | |
| # Clones repository without persisting credentials | |
| # As this local git repository is packed with installer | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| persist-credentials: '' | |
| - name: Get tag version | |
| id: tag | |
| uses: battila7/get-version-action@v2 | |
| - name: Set version (Release) | |
| if: startsWith(github.ref, 'refs/tags/v') == true | |
| run: echo '#define MyAppVersion "${{ steps.tag.outputs.version-without-v }}"' > launcher/windows/version.txt | |
| - name: Set version | |
| if: startsWith(github.ref, 'refs/tags/v') != true | |
| run: echo '#define MyAppVersion "1.0-${{ github.sha }}"' > launcher/windows/version.txt | |
| - name: Build Windows Installer | |
| run: .\launcher\windows\build.ps1 | |
| - name: Upload Installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: installers | |
| path: launcher/windows/build/Output/ | |
| retention-days: 5 | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ['self-hosted', 'win-signing-runner'] | |
| needs: windows-installer | |
| steps: | |
| - name: Download Windows installer | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: 'installers' | |
| path: installers | |
| # Sign Launcher | |
| - name: Sign Windows Launcher | |
| run: | | |
| "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\signtool.exe" sign /f "C:\luxonis.cer" /csp "eToken Base Cryptographic Provider" /k "[{{${{ secrets.SECTIGO_CERT_PASSWORD }}}}]=Sectigo_20241111150706" /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "Luxonis Holding Corporation" "installers/DepthAI_setup.exe" | |
| - name: Get current tag | |
| id: tag | |
| uses: battila7/get-version-action@v2 | |
| # Create GitHub release | |
| - uses: actions/create-release@master | |
| id: createRelease | |
| name: Create ${{ steps.tag.outputs.version }} DepthAI Demo release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.tag.outputs.version }} | |
| release_name: DepthAI Demo ${{ steps.tag.outputs.version }} | |
| body: | | |
| ## Features | |
| ## Bugs | |
| ## Misc | |
| draft: true | |
| # Upload release assets | |
| - name: Upload Windows Installer | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.createRelease.outputs.upload_url }} | |
| asset_path: ${{ github.workspace }}\installers\DepthAI_setup.exe | |
| asset_name: DepthAI-setup-${{ steps.tag.outputs.version }}.exe | |
| asset_content_type: application/octet-stream |