Add TextInputState/Renderer, move MeasureText to Renderer<T> base #470
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: CI/CD | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| VERSION_PREFIX: 3.6.${{ github.run_number }} | |
| VERSION_REV: ${{ github.run_attempt }} | |
| VERSION_HASH: +${{ github.sha }} | |
| BUILD_CONF: Release | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| working-directory: src | |
| - name: Build | |
| run: dotnet build -c $BUILD_CONF --no-restore -p:Version=${VERSION_PREFIX}${VERSION_REV}${VERSION_HASH} -p:FileVersion=${VERSION_PREFIX}.${VERSION_REV} -p:ContinuousIntegrationBuild=true | |
| working-directory: src | |
| - name: Upload NuGet package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: '**/*.nupkg' | |
| retention-days: 5 | |
| test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install astrometry.net | |
| run: sudo apt-get update && sudo apt-get install -y astrometry.net astrometry-data-2mass-08-19 | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| working-directory: src | |
| - name: Build | |
| run: dotnet build -c $BUILD_CONF --no-restore -p:Version=${VERSION_PREFIX}${VERSION_REV}${VERSION_HASH} -p:FileVersion=${VERSION_PREFIX}.${VERSION_REV} -p:ContinuousIntegrationBuild=true | |
| working-directory: src | |
| - name: Test | |
| run: dotnet test -c $BUILD_CONF --no-build | |
| working-directory: src | |
| publish-apps: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { os: windows-latest, rid: win-x64 } | |
| - { os: windows-latest, rid: win-arm64 } | |
| - { os: ubuntu-latest, rid: linux-x64 } | |
| - { os: ubuntu-24.04-arm, rid: linux-arm64 } | |
| - { os: macos-latest, rid: osx-arm64 } | |
| - { os: macos-latest, rid: osx-x64 } | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Publish TianWen.Lib.CLI | |
| run: dotnet publish src/TianWen.Lib.CLI/TianWen.Lib.CLI.csproj -r ${{ matrix.rid }} -c Release -p:Version=${VERSION_PREFIX}${VERSION_REV}${VERSION_HASH} -p:FileVersion=${VERSION_PREFIX}.${VERSION_REV} -p:GeneratePackageOnBuild=false | |
| shell: bash | |
| - name: Publish TianWen.UI.FitsViewer | |
| run: dotnet publish src/TianWen.UI.FitsViewer/TianWen.UI.FitsViewer.csproj -r ${{ matrix.rid }} -c Release -p:Version=${VERSION_PREFIX}${VERSION_REV}${VERSION_HASH} -p:FileVersion=${VERSION_PREFIX}.${VERSION_REV} -p:GeneratePackageOnBuild=false | |
| shell: bash | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: tianwen-cli-${{ matrix.rid }} | |
| path: src/TianWen.Lib.CLI/bin/Release/net10.0/${{ matrix.rid }}/publish/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: tianwen-fits-viewer-${{ matrix.rid }} | |
| path: src/TianWen.UI.FitsViewer/bin/Release/net10.0/${{ matrix.rid }}/publish/ | |
| release: | |
| needs: publish-apps | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create release archives | |
| run: | | |
| cd artifacts | |
| for dir in tianwen-cli-* tianwen-fits-viewer-*/; do | |
| name="${dir%/}" | |
| tar -czf "../${name}.tar.gz" -C "$dir" . | |
| done | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.VERSION_PREFIX }} | |
| name: v${{ env.VERSION_PREFIX }} | |
| generate_release_notes: true | |
| files: | | |
| tianwen-cli-*.tar.gz | |
| tianwen-fits-viewer-*.tar.gz | |
| publish-nuget: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Download NuGet packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| - name: Push NuGet package | |
| run: dotnet nuget push **/*.nupkg -s nuget.org -k ${{ secrets.NUGET_API_KEY }} |