Merge pull request #3132 from Wurschdhaud/improv-settings-window #1028
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: pyRevitCI | |
| on: | |
| # when PRs from forked repos are merged | |
| push: | |
| branches: | |
| - develop | |
| paths: | |
| - 'bin/**' | |
| - 'dev/**' | |
| - 'extensions/**' | |
| - 'pyrevitlib/**' | |
| - 'release/**' | |
| - 'site-packages/**' | |
| # when PR from develop->master is created | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - 'bin/**' | |
| - 'dev/**' | |
| - 'extensions/**' | |
| - 'pyrevitlib/**' | |
| - 'release/**' | |
| - 'site-packages/**' | |
| # manual run | |
| workflow_dispatch: | |
| env: | |
| ReleaseBranch: "master" | |
| MainRepo: "pyrevitlabs/pyRevit" | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Report Context | |
| run: | | |
| echo "run: ${{ github.run_number }}" | |
| echo "job: ${{ github.job }}" | |
| echo "event_name: ${{ github.event_name }}" | |
| echo "event_path: ${{ github.event_path }}" | |
| echo "repository: ${{ github.repository }}" | |
| echo "ref: ${{ github.ref }}" | |
| echo "head_ref: ${{ github.head_ref }}" | |
| echo "base_ref: ${{ github.base_ref }}" | |
| echo "commit: ${{ github.sha }}" | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Prepare Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pipenv' | |
| - name: Prepare pipenv | |
| run: | | |
| pip install pipenv | |
| pipenv install | |
| # needed for MahApps XamlColorSchemeGenerator | |
| - name: Prepare .NET SDKs | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 3.1.x | |
| 8.0.x | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Prepare .NET 10.0 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Prepare msbuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Prepare git | |
| if: (github.repository == env.MainRepo) | |
| uses: fregante/setup-git-user@v2 | |
| - name: Check Build Environment | |
| if: (github.repository == env.MainRepo) | |
| run: pipenv run pyrevit check | |
| - name: Update Copyright Info | |
| if: (github.repository == env.MainRepo) | |
| run: | | |
| pipenv run pyrevit set year | |
| # WIP only | |
| - name: Update Build Info (WIP) | |
| if: (github.base_ref != env.ReleaseBranch && github.repository == env.MainRepo) | |
| run: | | |
| pipenv run pyrevit set build wip | |
| # RELEASE only | |
| - name: Update Build Info (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| run: | | |
| pipenv run pyrevit set build release | |
| - name: Publish Build Info | |
| if: (github.repository == env.MainRepo) | |
| run: | | |
| pipenv run pyrevit set products | |
| - name: Build Products | |
| run: | | |
| pipenv run pyrevit build products | |
| - name: Get Build Version | |
| if: (github.repository == env.MainRepo) | |
| id: buildversion | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: pyrevitlib/pyrevit/version | |
| - name: Get Install Version | |
| id: installversion | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: release/version | |
| - name: Sign files with Trusted Signing (DLLs and EXEs) | |
| if: (github.repository == env.MainRepo) | |
| uses: azure/trusted-signing-action@v1.1.0 | |
| with: | |
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
| trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }} | |
| certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }} | |
| files-folder: bin/ | |
| files-folder-filter: pyrevit*.exe,pyrevit*.dll,pyRevit*.dll | |
| files-folder-recurse: true | |
| file-digest: SHA256 | |
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
| timestamp-digest: SHA256 | |
| - name: Build Installers | |
| run: | | |
| pipenv run pyrevit build installers | |
| - name: Sign files with Trusted Signing (installers) | |
| if: (github.repository == env.MainRepo) | |
| uses: azure/trusted-signing-action@v1.1.0 | |
| with: | |
| azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
| trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }} | |
| certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }} | |
| # Sign all exes inside the folder | |
| files-folder: dist/ | |
| files-folder-filter: exe,msi | |
| file-digest: SHA256 | |
| timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
| timestamp-digest: SHA256 | |
| - name: Upload Installers | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pyrevit-installers | |
| path: | | |
| dist/pyRevit_${{ steps.installversion.outputs.content }}_signed.exe | |
| dist/pyRevit_${{ steps.installversion.outputs.content }}_admin_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.msi | |
| dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg | |
| - name: Generate Release Notes (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pipenv run pyrevit report releasenotes > release_notes.md | |
| - name: Commit & Tag Changes (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| # configure git and commit changes | |
| run: | | |
| pipenv run pyrevit build commit | |
| git push | |
| git push --tags | |
| - name: Publish Release (Release) | |
| id: publish_release | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.buildversion.outputs.content }} | |
| name: pyRevit v${{ steps.installversion.outputs.content }} | |
| body_path: release_notes.md | |
| draft: true | |
| prerelease: false | |
| files: | | |
| dist/pyRevit_${{ steps.installversion.outputs.content }}_signed.exe | |
| dist/pyRevit_${{ steps.installversion.outputs.content }}_admin_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.exe | |
| dist/pyRevit_CLI_${{ steps.installversion.outputs.content }}_admin_signed.msi | |
| dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg | |
| - name: Publish Choco Packages (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| run: | | |
| choco apikey --key ${{ secrets.CHOCO_TOKEN}} --source https://push.chocolatey.org/ | |
| choco push dist/pyrevit-cli.${{ steps.installversion.outputs.content }}.nupkg -s https://push.chocolatey.org/ | |
| - name: Merge To Master (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| # configure git and commit changes | |
| run: | | |
| git checkout ${{ github.base_ref }} | |
| git merge ${{ github.head_ref }} | |
| git push | |
| git checkout ${{ github.head_ref }} | |
| - name: Notify Issue Threads (WIP) | |
| if: (github.ref == 'refs/heads/develop' && github.repository == env.MainRepo) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pipenv run pyrevit notify wip https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| - name: Notify Issue Threads (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pipenv run pyrevit notify release ${{ steps.publish_release.outputs.url }} | |
| - name: Increment Version & Commit (Release) | |
| if: (github.base_ref == env.ReleaseBranch && github.repository == env.MainRepo) | |
| run: | | |
| pipenv run pyrevit set next-version | |
| git push |