Add funding information to FUNDING.yml #47
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: Build and Sign | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| workflow_call: | |
| inputs: | |
| version: | |
| description: 'Version number for release builds' | |
| required: false | |
| type: string | |
| use_release_signing: | |
| description: 'Use release certificate' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Generate Version Number | |
| id: version | |
| shell: bash | |
| run: | | |
| # Check if version was provided as input for releases | |
| if [[ -n "${{ inputs.version }}" ]]; then | |
| VERSION="${{ inputs.version }}" | |
| echo "Building release version: $VERSION" | |
| else | |
| # Development build with commit count and SHA | |
| BASE_VERSION=$(cat VERSION) | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| COMMIT_COUNT=$(git rev-list --count ${LAST_TAG}..HEAD) | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| VERSION="${BASE_VERSION}-${COMMIT_COUNT}+${SHORT_SHA}" | |
| echo "Building development version: $VERSION" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: DotNet Build and Publish | |
| run: dotnet publish XBatteryStatus/XBatteryStatus.csproj -p:PublishProfile=XBatteryStatus\Properties\PublishProfiles\FolderProfile.pubxml -p:Version=${{ steps.version.outputs.version }} | |
| - name: Build MSI Installer | |
| uses: caphyon/advinst-github-action@main | |
| with: | |
| advinst-version: '23.3' | |
| advinst-license: ${{ secrets.ADVINST_LICENSE_KEY }} | |
| advinst-enable-automation: 'true' | |
| aip-path: ${{ github.workspace }}\Installer/XBatteryStatus.aip | |
| aip-build-name: x64_Release | |
| aip-package-name: XBatteryStatus.msi | |
| aip-output-dir: ${{ github.workspace }}\Installer\setup | |
| - name: Build MSI Offline Installer | |
| uses: caphyon/advinst-github-action@main | |
| with: | |
| advinst-version: '23.3' | |
| advinst-license: ${{ secrets.ADVINST_LICENSE_KEY }} | |
| advinst-enable-automation: 'true' | |
| aip-path: ${{ github.workspace }}\Installer/XBatteryStatus_offline.aip | |
| aip-build-name: x64_Release | |
| aip-package-name: XBatteryStatus_offline.msi | |
| aip-output-dir: ${{ github.workspace }}\Installer\setup | |
| - name: Create Signing Package | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path unsigned | |
| Copy-Item "XBatteryStatus/bin/Release/publish/XBatteryStatus.exe" -Destination "unsigned/" | |
| Copy-Item "Installer/setup/XBatteryStatus.msi" -Destination "unsigned/" | |
| Copy-Item "Installer/setup/XBatteryStatus_offline.msi" -Destination "unsigned/" | |
| - name: Publish Unsigned Package Artifact | |
| id: unsigned-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unsigned-package | |
| path: unsigned/ | |
| - name: Determine Signing Policy | |
| id: signing | |
| shell: bash | |
| run: | | |
| if [[ "${{ inputs.use_release_signing }}" == "true" ]]; then | |
| echo "policy=release-signing" >> $GITHUB_OUTPUT | |
| echo "Using release signing certificate" | |
| else | |
| echo "policy=test-signing" >> $GITHUB_OUTPUT | |
| echo "Using test signing certificate" | |
| fi | |
| - name: Sign Package | |
| uses: signpath/github-action-submit-signing-request@v1 | |
| with: | |
| api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' | |
| organization-id: '8ab4e21f-f24a-4a69-a19f-54da7a9abb72' | |
| project-slug: 'XBatteryStatus' | |
| signing-policy-slug: '${{ steps.signing.outputs.policy }}' | |
| artifact-configuration-slug: 'Sign_Package' | |
| github-artifact-id: '${{ steps.unsigned-artifact.outputs.artifact-id }}' | |
| wait-for-completion: true | |
| output-artifact-directory: 'signed' | |
| - name: Publish Signed Executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: signed-executable | |
| path: signed/XBatteryStatus.exe | |
| - name: Publish Signed Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: signed-installer | |
| path: signed/XBatteryStatus.msi | |
| - name: Publish Signed Offline Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: signed-offline-installer | |
| path: signed/XBatteryStatus_offline.msi |