diff --git a/.editorconfig b/.editorconfig index d72111f..6b69d84 100644 --- a/.editorconfig +++ b/.editorconfig @@ -20,6 +20,10 @@ charset = utf-8 # See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926 trim_trailing_whitespace = false +[*.yml] +indent_style = tab +indent_size = 2 + # Sort using and Import directives with System.* appearing first dotnet_sort_system_directives_first = true @@ -29,7 +33,7 @@ dotnet_style_qualification_for_property = false:suggestion dotnet_style_qualification_for_method = false:suggestion dotnet_style_qualification_for_event = false:suggestion -#### Naming styles #### +#### Naming styles # Naming rules diff --git a/.github/install_dependencies/action.yml b/.github/install_dependencies/action.yml index d452ec9..bab130e 100644 --- a/.github/install_dependencies/action.yml +++ b/.github/install_dependencies/action.yml @@ -3,7 +3,7 @@ description: "" inputs: target-platform: - description: 'The platform to install dependencies for. #See available values at https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html' + description: 'The platform to install dependencies for. See available values at https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html' required: false default: 'all' dotnet-version: @@ -39,7 +39,8 @@ runs: run: | dotnet tool install -g uno.check ("${{ inputs.target-platform }} ".ToLower().Split(' ') | ForEach-Object { - $target = $_.Replace("_win", "").Replace("_macos", "") + $target = $_.Replace("_win", "").Replace("_macos", "").Replace("browserwasm", "wasm").Replace("windows", "wasdk") + $target = $target -replace '^net[^-]*-', '' if (![string]::IsNullOrEmpty($target)) { echo "target: $target" uno-check -v --ci --non-interactive --fix --target $target --skip vswin --skip vsmac --skip xcode --skip androidemulator --skip dotnetnewunotemplates diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06ec26a..9d4b8dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,11 @@ env: WORKING_DIR: ${{ github.workspace }} GLOBAL_JSON_PATH: '${{ github.workspace }}\global.json' SOLUTION_PATH: '${{ github.workspace }}\Elapsed.slnx' - APP_PROJECT_PATH: '${{ github.workspace }}\src\app\Riverside.Elapsed.App\Riverside.Elapsed.App.csproj' - CLI_PROJECT_PATH: '${{ github.workspace }}\src\app\Riverside.Elapsed.CommandLine\Riverside.Elapsed.CommandLine.csproj' + APP_PROJECT_PATH: '${{ github.workspace }}\src\platforms\Riverside.Elapsed.App\Riverside.Elapsed.App.csproj' + CLI_PROJECT_PATH: '${{ github.workspace }}\src\platforms\Riverside.Elapsed.CommandLine\Riverside.Elapsed.CommandLine.csproj' API_PROJECT_PATH: '${{ github.workspace }}\src\core\Riverside.Elapsed\Riverside.Elapsed.csproj' TUS_PROJECT_PATH: '${{ github.workspace }}\src\core\Riverside.ResumableUploads\Riverside.ResumableUploads.csproj' + MEDIA_PROJECT_PATH: '${{ github.workspace }}\src\core\Riverside.MediaRecording\Riverside.MediaRecording.csproj' jobs: formatting: @@ -38,7 +39,7 @@ jobs: $changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} foreach ($file in $changedFiles) { - xstyler -p -l None -f $file + xstyler -p -l None -f $file --indent-tabs true --comment-spaces 1 if ($LASTEXITCODE -ne 0) { echo "::error file=$file::Format check failed" @@ -55,11 +56,13 @@ jobs: strategy: fail-fast: false matrix: - configuration: [Preview, Release] - platform: [Desktop, Android, iOS, BrowserWASM] + configuration: [Debug, Release] + project: [App] + targetFramework: [net10.0-windows10.0.26100.0, net10.0-desktop, net10.0-android, net10.0-ios, net10.0-browserwasm] env: CONFIGURATION: ${{ matrix.configuration }} - PLATFORM: ${{ matrix.platform }} + TFM: ${{ matrix.targetFramework }} + ID: runtime.any.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }} steps: - name: Checkout the repository @@ -71,7 +74,7 @@ jobs: - name: Install Dependencies uses: "./.github/install_dependencies" with: - target-platform: ${{ matrix.platform }} + target-platform: ${{ matrix.targetFramework }} dotnet-version: 10.0.102 global-json-file: ${{ env.GLOBAL_JSON_PATH }} @@ -89,41 +92,42 @@ jobs: run: | msbuild $env:SOLUTION_PATH ` -t:Restore ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION - name: Build - if: matrix.platform == 'iOS' + if: contains(matrix.targetFramework, 'ios') run: | msbuild $env:APP_PROJECT_PATH ` -t:Build ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION ` - -p:TargetFramework=net10.0-$($env:PLATFORM.ToLower()) + -p:TargetFramework=$env:TFM - name: Build & publish - if: matrix.platform != 'iOS' + if: contains(matrix.targetFramework, 'ios') == false run: | msbuild $env:APP_PROJECT_PATH ` -t:Publish ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION ` - -p:TargetFramework=net10.0-$($env:PLATFORM.ToLower()) + -p:TargetFramework=$env:TFM - name: Upload artifact uses: actions/upload-artifact@v7 with: - name: 'Riverside.Elapsed.App_${{ env.CONFIGURATION }}_net10.0-${{ env.PLATFORM }}' - path: '${{ github.workspace }}\bin\Riverside.Elapsed.App\${{ env.CONFIGURATION }}\net10.0-${{ env.PLATFORM }}' + name: '${{ env.ID }}' + path: '${{ github.workspace }}\bin\Riverside.Elapsed.App\AnyCPU\${{ env.CONFIGURATION }}\${{ env.TFM }}' cli: runs-on: windows-2025-vs2026 strategy: - fail-fast: false + fail-fast: true matrix: - configuration: [Preview, Release] + configuration: [Debug, Release] + project: [CommandLine] + targetFramework: [net10.0] env: CONFIGURATION: ${{ matrix.configuration }} + TFM: ${{ matrix.targetFramework }} + ID: runtime.any.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }} steps: - name: Checkout the repository @@ -149,30 +153,33 @@ jobs: run: | msbuild $env:SOLUTION_PATH ` -t:Restore ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION - name: Build & publish run: | msbuild $env:CLI_PROJECT_PATH ` -t:Publish ` - -p:Platform="Any CPU" ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -p:TargetFramework=$env:TFM - name: Upload artifact uses: actions/upload-artifact@v7 with: - name: 'Riverside.Elapsed.CommandLine_${{ env.CONFIGURATION }}' - path: '${{ github.workspace }}\bin\Riverside.Elapsed.CommandLine\${{ env.CONFIGURATION }}' + name: '${{ env.ID }}' + path: '${{ github.workspace }}\bin\Riverside.Elapsed.CommandLine\AnyCPU\${{ env.CONFIGURATION }}\${{ env.TFM }}' api: runs-on: windows-2025-vs2026 strategy: - fail-fast: false + fail-fast: true matrix: - configuration: [Preview, Release] + configuration: [Debug, Release] + project: [Elapsed] + targetFramework: [netstandard2.1] env: CONFIGURATION: ${{ matrix.configuration }} + TFM: ${{ matrix.targetFramework }} + ID: runtime.any.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }} steps: - name: Checkout the repository @@ -198,30 +205,33 @@ jobs: run: | msbuild $env:SOLUTION_PATH ` -t:Restore ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION - name: Build & publish run: | msbuild $env:API_PROJECT_PATH ` -t:Publish ` - -p:Platform="Any CPU" ` - -p:Configuration=$env:CONFIGURATION + -p:Configuration=$env:CONFIGURATION ` + -p:TargetFramework=$env:TFM - name: Upload artifact uses: actions/upload-artifact@v7 with: - name: 'Riverside.Elapsed_${{ env.CONFIGURATION }}' - path: '${{ github.workspace }}\bin\Riverside.Elapsed\${{ env.CONFIGURATION }}' + name: '${{ env.ID }}' + path: '${{ github.workspace }}\bin\Riverside.Elapsed\AnyCPU\${{ env.CONFIGURATION }}\${{ env.TFM }}' tus: runs-on: windows-2025-vs2026 strategy: - fail-fast: false + fail-fast: true matrix: - configuration: [Preview, Release] + configuration: [Debug, Release] + project: [ResumableUploads] + targetFramework: [netstandard2.1] env: CONFIGURATION: ${{ matrix.configuration }} + TFM: ${{ matrix.targetFramework }} + ID: runtime.any.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }} steps: - name: Checkout the repository @@ -243,27 +253,78 @@ jobs: run: | msbuild $env:SOLUTION_PATH ` -t:Restore ` - -p:Platform="Any CPU" ` -p:Configuration=$env:CONFIGURATION - name: Build & publish run: | msbuild $env:TUS_PROJECT_PATH ` -t:Publish ` - -p:Platform="Any CPU" ` + -p:Configuration=$env:CONFIGURATION ` + -p:TargetFramework=$env:TFM + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: '${{ env.ID }}' + path: '${{ github.workspace }}\bin\Riverside.ResumableUploads\AnyCPU\${{ env.CONFIGURATION }}\${{ env.TFM }}' + + media: + runs-on: windows-2025-vs2026 + strategy: + fail-fast: true + matrix: + configuration: [Debug, Release] + project: [MediaRecording] + targetFramework: [net10.0-windows] + env: + CONFIGURATION: ${{ matrix.configuration }} + TFM: ${{ matrix.targetFramework }} + ID: runtime.any.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }} + + steps: + - name: Checkout the repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Install Dependencies + uses: "./.github/install_dependencies" + with: + dotnet-version: 10.0.102 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v3 + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + + - name: Restore + run: | + msbuild $env:SOLUTION_PATH ` + -t:Restore ` -p:Configuration=$env:CONFIGURATION + - name: Build & publish + run: | + msbuild $env:MEDIA_PROJECT_PATH ` + -t:Publish ` + -p:Configuration=$env:CONFIGURATION ` + -p:TargetFramework=$env:TFM + - name: Upload artifact uses: actions/upload-artifact@v7 with: - name: 'Riverside.ResumableUploads_${{ env.CONFIGURATION }}' - path: '${{ github.workspace }}\bin\Riverside.ResumableUploads\${{ env.CONFIGURATION }}' + name: '${{ env.ID }}' + path: '${{ github.workspace }}\bin\Riverside.MediaRecording\AnyCPU\${{ env.CONFIGURATION }}\${{ env.TFM }}' publish-releases: if: | - github.event_name == 'push' && - github.ref == 'refs/heads/main' - needs: [app, cli, api, tus] + github.event_name == 'push' && + github.ref == 'refs/heads/main' && + contains( + join(github.event.commits.*.modified, ','), + 'eng/CurrentVersion.props' + ) + needs: [app, cli, api, tus, media] runs-on: windows-latest environment: name: GitHub Releases @@ -276,8 +337,6 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v8 - with: - path: .\artifacts - name: Determine release mode id: mode @@ -290,126 +349,26 @@ jobs: [xml]$versionProps = Get-Content $versionPropsPath $majorVersion = $versionProps.Project.PropertyGroup.MajorVersion $minorVersion = $versionProps.Project.PropertyGroup.MinorVersion + $releaseLevel = $versionProps.Project.PropertyGroup.ReleaseLevel + $betaVersion = $versionProps.Project.PropertyGroup.BetaVersion $buildDate = Get-Date -Format 'yyMMdd' - $latestTag = (git describe --tags --abbrev=0 2>$null) - $betaVersion = 1 - if ($latestTag -match '-preview(\d+)$') { - $betaVersion = [int]$Matches[1] + 1 - } else { - $minorVersion = [int]$minorVersion + 1 - } - - if ($before -eq '0000000000000000000000000000000000000000') { - $versionFileChanged = $false - } - else { - $changedFiles = git diff --name-only $before $after - $versionFileChanged = $changedFiles -contains 'eng/CurrentVersion.props' - } - - if ($versionFileChanged) { + if ($releaseLevel -eq "final") { $tag = "v$majorVersion.$minorVersion.$buildDate" - "config=Release" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "prerelease=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "make_latest=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "channel=release" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "release_name=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + $prerelease = "false" + $release_name = "$majorVersion.$minorVersion" } else { - $tag = "v$majorVersion.$minorVersion.$buildDate-preview$betaVersion" - "config=Preview" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "prerelease=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "make_latest=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "channel=preview" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - "release_name=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } - - - name: Prepare release assets - id: assets - shell: pwsh - run: | - $ErrorActionPreference = 'Stop' - - $selectedConfig = "${{ steps.mode.outputs.config }}" - $artifactsRoot = Join-Path $env:GITHUB_WORKSPACE 'artifacts' - $releaseAssetsRoot = Join-Path $env:GITHUB_WORKSPACE 'release-assets' - - if (Test-Path $releaseAssetsRoot) { - Remove-Item $releaseAssetsRoot -Recurse -Force - } - New-Item -ItemType Directory -Path $releaseAssetsRoot | Out-Null - - function New-ZipFromFolder { - param( - [Parameter(Mandatory = $true)] [string] $SourceFolder, - [Parameter(Mandatory = $true)] [string] $DestinationZip - ) - - if (Test-Path $DestinationZip) { - Remove-Item $DestinationZip -Force - } - - Compress-Archive -Path (Join-Path $SourceFolder '*') -DestinationPath $DestinationZip -Force - } - - $appDirs = Get-ChildItem $artifactsRoot -Directory | Where-Object { - $_.Name -match "^Riverside\.Elapsed\.App_${selectedConfig}_net10\.0-(Android|Desktop|iOS|BrowserWASM)$" - } - - foreach ($dir in $appDirs) { - $platform = ([regex]::Match($dir.Name, 'net10\.0-([A-Za-z0-9]+)$')).Groups[1].Value.ToLowerInvariant() - $zipPath = Join-Path $releaseAssetsRoot "Hackclub501.Elapsed.App_net10.0-${platform}.zip" - New-ZipFromFolder -SourceFolder $dir.FullName -DestinationZip $zipPath - } - - $cliDirs = Get-ChildItem $artifactsRoot -Directory | Where-Object { - $_.Name -match "^Riverside\.Elapsed\.CommandLine_${selectedConfig}$" - } - - foreach ($dir in $cliDirs) { - $zipPath = Join-Path $releaseAssetsRoot 'Hackclub501.Elapsed.CommandLine.zip' - New-ZipFromFolder -SourceFolder $dir.FullName -DestinationZip $zipPath - } - - $apiDirs = Get-ChildItem $artifactsRoot -Directory | Where-Object { - $_.Name -match "^Riverside\.Elapsed_${selectedConfig}$" - } - - $tusDirs = Get-ChildItem $artifactsRoot -Directory | Where-Object { - $_.Name -match "^Riverside\.ResumableUploads_${selectedConfig}$" - } - - foreach ($dir in $apiDirs) { - $packageFiles = Get-ChildItem $dir.FullName -File | Where-Object { - $_.Extension -in '.nupkg', '.snupkg' - } - - foreach ($package in $packageFiles) { - $destinationName = "Hackclub501.Elapsed$($package.Extension)" - Copy-Item -Path $package.FullName -Destination (Join-Path $releaseAssetsRoot $destinationName) -Force - } + $tag = "v$majorVersion.$minorVersion.$buildDate-$releaseLevel$betaVersion" + $prerelease = "true" + $release_name = "$majorVersion.$minorVersion-$releaseLevel$betaVersion" } - foreach ($dir in $tusDirs) { - $packageFiles = Get-ChildItem $dir.FullName -File | Where-Object { - $_.Extension -in '.nupkg', '.snupkg' - } - - foreach ($package in $packageFiles) { - $destinationName = "Hackclub501.Tus$($package.Extension)" - Copy-Item -Path $package.FullName -Destination (Join-Path $releaseAssetsRoot $destinationName) -Force - } - } - - $preparedAssets = Get-ChildItem $releaseAssetsRoot -File - if ($preparedAssets.Count -eq 0) { - throw "No release assets were prepared for configuration '$selectedConfig'." - } - - "path=$releaseAssetsRoot" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "prerelease=$prerelease" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "make_latest=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "channel=release" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + "release_name=$release_name" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - name: Draft release uses: softprops/action-gh-release@v2 @@ -421,22 +380,32 @@ jobs: token: ${{ secrets.USER_TOKEN }} prerelease: ${{ steps.mode.outputs.prerelease }} files: | - ${{ steps.assets.outputs.path }}\* + runtime.*.Environment-Release\* publish-nuget: if: | - github.event_name == 'push' && - github.ref == 'refs/heads/main' - needs: [cli, api, tus] + github.event_name == 'push' && + github.ref == 'refs/heads/main' && + contains( + join(github.event.commits.*.modified, ','), + 'eng/CurrentVersion.props' + ) + needs: [cli, api, tus, media] runs-on: windows-latest strategy: fail-fast: false matrix: - product: [CLI, API, ResumableUploads] + product: [CommandLine, ResumableUploads, MediaRecording, Elapsed] environment: name: NuGet env: PRODUCT: ${{ matrix.product }} + ID_CLI: runtime.any.CommandLine.net10.0.Environment-Release + ID_TUS: runtime.any.ResumableUploads.netstandard2.1.Environment-Release + ID_MEDIA: runtime.any.MediaRecording.net10.0-windows.Environment-Release + ID_API: runtime.any.Elapsed.netstandard2.1.Environment-Release + permissions: + id-token: write steps: - name: Checkout the repository @@ -444,65 +413,41 @@ jobs: with: fetch-depth: 0 + - name: Authenticate with NuGet + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGET_USER }} + - name: Download artifacts uses: actions/download-artifact@v8 - - name: Detect version file changes - id: version_file - shell: pwsh - run: | - $before = "${{ github.event.before }}" - $after = "${{ github.sha }}" - - if ($before -eq '0000000000000000000000000000000000000000') { - "changed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - exit 0 - } - - $changedFiles = git diff --name-only $before $after - if ($changedFiles -contains 'eng/CurrentVersion.props') { - "changed=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } - else { - "changed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } - - name: Publish release to NuGet - if: | - steps.version_file.outputs.changed == 'true' id: nuget_release shell: pwsh run: | - if ($env:PRODUCT -eq "CLI") { - $artifact=".\Riverside.Elapsed.CommandLine_Release\*.nupkg" + if ($env:PRODUCT -eq "CommandLine") { + $artifact=".\${{ env.ID_CLI }}\*.nupkg" } elseif ($env:PRODUCT -eq "ResumableUploads") { - $artifact=".\Riverside.ResumableUploads_Release\*.nupkg" - } - else { - $artifact=".\Riverside.Elapsed_Release\*.nupkg" - } - dotnet nuget push $artifact --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - - - name: Publish preview to NuGet - if: steps.version_file.outputs.changed != 'true' - shell: pwsh - run: | - if ($env:PRODUCT -eq "CLI") { - $artifact=".\Riverside.Elapsed.CommandLine_Preview\*.nupkg" + $artifact=".\${{ env.ID_TUS }}\*.nupkg" } elseif ($env:PRODUCT -eq "ResumableUploads") { - $artifact=".\Riverside.ResumableUploads_Preview\*.nupkg" + $artifact=".\${{ env.ID_MEDIA }}\*.nupkg" } else { - $artifact=".\Riverside.Elapsed_Preview\*.nupkg" + $artifact=".\${{ env.ID_API }}\*.nupkg" } - dotnet nuget push $artifact --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json + dotnet nuget push $artifact --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json publish-web: if: | - github.event_name == 'push' && - github.ref == 'refs/heads/main' + github.event_name == 'push' && + github.ref == 'refs/heads/main' && + contains( + join(github.event.commits.*.modified, ','), + 'eng/CurrentVersion.props' + ) needs: [app] runs-on: windows-latest environment: @@ -510,6 +455,7 @@ jobs: env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + ID: runtime.any.App.net10.0-browserwasm.Environment-Release steps: - name: Checkout the repository @@ -522,46 +468,17 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v8 - - - name: Detect version file changes - id: version_file - shell: pwsh - run: | - $before = "${{ github.event.before }}" - $after = "${{ github.sha }}" - - if ($before -eq '0000000000000000000000000000000000000000') { - "changed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - exit 0 - } - - $changedFiles = git diff --name-only $before $after - if ($changedFiles -contains 'eng/CurrentVersion.props') { - "changed=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } - else { - "changed=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append - } + with: + name: ${{ env.ID }} + path: ${{ github.workspace }}\elapsed - name: Publish release to web - if: | - steps.version_file.outputs.changed == 'true' - id: web_release shell: pwsh run: | - cd ".\Riverside.Elapsed.App_Release_net10.0-browserwasm" + cd ".\elapsed" vercel pull --yes --prod --token=${{ secrets.VERCEL_TOKEN }} - vercel build --yes --target=preview --token=${{ secrets.VERCEL_TOKEN }} - vercel deploy --yes --prebuilt --target=preview --token=${{ secrets.VERCEL_TOKEN }} - - - name: Publish preview to web - if: steps.version_file.outputs.changed != 'true' - shell: pwsh - run: | - cd ".\Riverside.Elapsed.App_Preview_net10.0-browserwasm" - vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - vercel build --yes --target=preview --token=${{ secrets.VERCEL_TOKEN }} - vercel deploy --yes --prebuilt --target=preview --token=${{ secrets.VERCEL_TOKEN }} + vercel build --yes --prod --token=${{ secrets.VERCEL_TOKEN }} + vercel deploy --yes --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} # publish-marketplaces: # if: | diff --git a/.gitignore b/.gitignore index 7c189af..7b8c623 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ bld/ .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot wwwroot/ +!**/WebAssembly/wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ diff --git a/.run/Riverside.Elapsed.App.run.xml b/.run/Riverside.Elapsed.App.run.xml index c8d132e..4de64b1 100644 --- a/.run/Riverside.Elapsed.App.run.xml +++ b/.run/Riverside.Elapsed.App.run.xml @@ -1,6 +1,6 @@ - - - - - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)src - $(RootDirectory)eng - $(RootDirectory).github - - $(SourceDirectory)\app - $(SourceDirectory)\core - - $(RootDirectory)bin\$(MSBuildProjectName)\$(Configuration)\$(TargetFramework)\ - $(RootDirectory)wwwroot\ - - - - - - - - <_LatestGitTag>$(_LatestGitTag.Trim()) - <_BetaMatch>$([System.Text.RegularExpressions.Regex]::Match('$(_LatestGitTag)', '-preview(\d+)$').Groups[1].Value) - - - 1 - - - $([MSBuild]::Add($(_BetaMatch), 1)) - - - $([MSBuild]::Add($(MinorVersion), 1)) - - Elapsed - Hackclub - - final - preview - <_LatestGitTag> - <_BetaMatch> - - $([System.DateTime]::Now.ToString("yy")) - $([System.DateTime]::Now.ToString("MM")) - $([System.DateTime]::Now.ToString("dd")) - $(CurrentYear)$(CurrentMonth)$(CurrentDay) - - $(MajorVersion).$(MinorVersion) - - $(AssemblyVersion).$(BuildDate) - - $(Product) - $(MSBuildProjectName) - $(AssemblyVersion).0 - - $(Company) - - $(BaseDisplayVersion) - $(BaseDisplayVersion)-$(ReleaseLevel)$(BetaVersion) - $(DisplayVersion) - $(DisplayVersion) - - - false @@ -74,8 +13,8 @@ enable true - Preview;Release - $(DefineConstants);DEBUG + Debug;Release + AnyCPU $(TargetFramework.Contains('browserwasm')) @@ -87,16 +26,61 @@ --> $(NoWarn);NU1507;NETSDK1201;PRI257 + + + + $(MSBuildThisFileDirectory) + $(MSBuildThisFileDirectory)src + $(RootDirectory)eng + $(RootDirectory).github + + $(SourceDirectory)\platforms + $(SourceDirectory)\core + + + $(RootDirectory)bin\$(MSBuildProjectName)\$(Platform)\$(Configuration)\$(TargetFramework)\ + ..\..\..\wwwroot\ - - - true $(CIOutputDirectory) $(WebOutputDirectory) $(PublishDir) - + + + Elapsed + Hack Club + + preview + 1 + 0 + + $([System.DateTime]::Now.ToString("yy")) + $([System.DateTime]::Now.ToString("MM")) + $([System.DateTime]::Now.ToString("dd")) + $(CurrentYear)$(CurrentMonth)$(CurrentDay) + + $(MajorVersion).$(MinorVersion) + $(AssemblyVersion).$(BuildDate) + + $(Product) + $(MSBuildProjectName) + $(AssemblyVersion).$(BetaVersion) + + $(Company) + + $(BaseDisplayVersion) + $(BaseDisplayVersion)-$(ReleaseLevel)$(BetaVersion) + $(DisplayVersion) + $(DisplayVersion) + + + + + true + + + diff --git a/Elapsed.slnx b/Elapsed.slnx index bf6abe5..73e594b 100644 --- a/Elapsed.slnx +++ b/Elapsed.slnx @@ -1,6 +1,6 @@ - + @@ -9,11 +9,11 @@ - - + + - + diff --git a/README.md b/README.md index f462e95..c00623e 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,9 @@ > Find it on Hack Club > > -> Elapsed is currently in active development for Hackclub's [Campfire Flagship](https://flagship.hackclub.com) and [Hackclub: The Game](https://game.hackclub.com) programmes. -> *(this is not double dipping!)* +> Elapsed is currently in active development as a part of the ["Hack Club: The Game"](https://game.hackclub.com) programme, an event in New York City, organised by Hack Club. > -> If you are a Hackclub member and are interested in contributing, please reach out via the [`#elapsed`](https://hackclub.enterprise.slack.com/archives/C0AKTBFM0BU) channel on the Hackclub Slack! +> If you are a Hack Club member and are interested in contributing, please reach out via the [`#elapsed`](https://hackclub.enterprise.slack.com/archives/C0AKTBFM0BU) channel on the Hack Club Slack! @@ -194,7 +184,7 @@ It is recommended to have a good understanding of [how Microsoft Kiota works](ht **Contributions are welcome** - please feel free to add **missing features**, **new styles**, or **fix bugs**. And of course, please open as many issues or pull requests as you like! *All contributions are helpful in their own way.* -Because Elapsed is a Hackclub YSWS project, all time is tracked on Hackatime, Hackclub's software for tracking time spent across projects. +Because Elapsed is a Hack Club YSWS project, all time is tracked on Hackatime, Hack Club's software for tracking time spent across projects. *(and yes, all work on Elapsed was tracked using Lapse!)* Below are the two main clocks for Elapsed (the first being Elapsed itself, and the second being the "Advanced Compiler Services for .NET" project, which is responsible for the Lapse API projection): @@ -266,7 +256,7 @@ Elapsed/ ### Project design choices -As an **open-source project**, Elapsed is **developed in the open** by the Hackclub community and contributors from related projects. +As an **open-source project**, Elapsed is **developed in the open** by the Hack Club community and contributors from related projects. The **goal is simple**: deliver a **modern**, **high-performance** timelapse experience that is **accessible**, **transparent**, and **continuously evolving** across Windows, Mac, Linux, Android, iOS and more! #### Code style @@ -294,27 +284,30 @@ Versions follow the format `{MAJOR}.{MINOR}.{DATE}[-{LEVEL}{PRERELEASE}]`, where For example, a version could look like this: `2.2.260220`, or `2.5.260522-preview2`. -The Elapsed project contains two build configurations, Release and Preview. +The Elapsed project contains two build configurations, Release and Debug. Each build configuration has slightly different settings, and feature flags within the app may be dependent on which build configuration is enabled. -Generally, you should always build the 'Preview' configuration. +Generally, you should always build the 'Debug' configuration for development purposes, as it enables extra feature flags for debugging. -Releases are automatically published to GitHub and other marketplaces by the CD workflow. -The CD workflow runs on every push to main, and publishes a new Preview channel release to the deployment. -A release to the mainstream publishing channel (all marketplaces) can be triggered by updating the `eng/CurrentVersion.props` with a new version number. +Releases are automatically published to GitHub and other marketplaces (as listed below) by the CD workflow. +The release process can be induced by updating the `eng/CurrentVersion.props` with a new version number, which activates the CD pipeline. The CD workflow deploys to the following marketplaces: - GitHub Releases - NuGet +- Web - ~~Microsoft Store~~ - ~~Google Play Store~~ - ~~Apple App Store~~ Preview versions are only ever published to GitHub releases and NuGet. -The preview version number (the number 1 in `0.0.000000-preview1`) is calculated automatically by the CD workflow, based on what the previous release version was. +The preview version number (the number 1 in `0.0.000000-preview1`) is calculated automatically as a part of the build process, based on what the previous release version was. For example, if there is an existing preview with preview version 2, creating a new preview release will have the preview version value of 3. #### Trimming and native AOT compilation +> [!NOTE] +> Trimming and Native AOT compilation only occurs when the 'release' configuration of any project is built. + The Elapsed API projection is a .NET Standard 2.0 class library and executable projects are .NET 10 binaries; all *should* support Native AOT and trimming out of the box. The Elapsed CLI programme uses illegal methods (Reflection) that are not AOT or trimming safe. @@ -357,6 +350,7 @@ Elapse also relies on the following open source projects to function: - [Lapse](https://github.com/hackclub/lapse)'s API - [Hackatime](https://github.com/hackclub/hackatime)'s API - [Advanced Compiler Services for .NET](https://github.com/Lamparter/CompilerPlatform) +- [Win32 P/Invoke bindings for .NET Standard](https://github.com/Lamparter/Win32) - [.NET Command Line APIs](https://github.com/dotnet/command-line-api) - [Skia](https://github.com/google/skia) and [SkiaSharp](https://github.com/mono/SkiaSharp) - [Sentry](https://github.com/getsentry/sentry-dotnet) @@ -365,7 +359,7 @@ Elapse also relies on the following open source projects to function: This project is **free, open source software** licensed under the MIT License. -Elapsed is a Hackclub project, made by teenagers, for teenagers. +Elapsed is a Hack Club project, made by teenagers, for teenagers. There are no plans to make Elapsed a paid app. Please contact `@Lamparter` on Slack if you have legal questions. @@ -373,5 +367,5 @@ Please contact `@Lamparter` on Slack if you have legal questions. ---

- Made with <3 by teenagers, for teenagers. Learn more about Hackclub. + Made with <3 by teenagers, for teenagers. Learn more about Hack Club.

diff --git a/eng/CurrentVersion.props b/eng/CurrentVersion.props index 05b7a7b..4719b1b 100644 --- a/eng/CurrentVersion.props +++ b/eng/CurrentVersion.props @@ -14,6 +14,8 @@ GUIDE TO VERSIONING PRACTICES: 0 - 1 + 2 + preview + 1 diff --git a/eng/PackageLogo.png b/eng/PackageLogo.png index 527411a..b0428ea 100644 Binary files a/eng/PackageLogo.png and b/eng/PackageLogo.png differ diff --git a/eng/PackageMetadata.props b/eng/PackageMetadata.props index bc4d8fb..9fea6cb 100644 --- a/eng/PackageMetadata.props +++ b/eng/PackageMetadata.props @@ -2,14 +2,14 @@ True $(Product) - Lamparter, ascpixi, Hackclub + Lamparter, ascpixi, Hack Club Copyright (c) 2026 Lamparter README.md PackageLogo.png https://github.com/Lamparter/Elapsed git lapse; timelapse; elapsed; uno; unoplatform; windows; android; linux; macos; iphone; hackclub; riverside - "Elapsed" is a .NET wrapper and cross-platform application for Lapse, Hackclub's timelapse tracking tool + Elapsed is Hack Club's new timelapse tracking tool and media sharing platform. MIT True True diff --git a/src/README.md b/src/README.md index f41d146..b3b8fd6 100644 --- a/src/README.md +++ b/src/README.md @@ -1,10 +1,10 @@ # Elapsed -#### "Elapsed" is a .NET wrapper and cross-platform application for Lapse, Hackclub's timelapse tracking tool. +#### Elapsed is Hack Club's new timelapse tracking tool and media sharing platform. --- -Introducing **Elapsed**, a **high-performance**, **cross-platform**, **native app** for Hackclub's timelapse programme, [Lapse](https://lapse.hackclub.com), complete with a **modern UI** that is built from the ground up. +Introducing **Elapsed**, a **high-performance**, **cross-platform**, **native app** for Hack Club's timelapse programme, [Lapse](https://lapse.hackclub.com), complete with a **modern UI** that is built from the ground up. It is designed to feel **just like any other native app** on every platform it supports. Built with .NET and Uno Platform, it **brings the Lapse experience** to desktop and mobile with a **responsive**, **dynamic interface**, **smooth navigation**, and a feature set tailored for **real timelapse workflows** rather than a direct web clone. diff --git a/src/app/Riverside.Elapsed.App/App.xaml b/src/app/Riverside.Elapsed.App/App.xaml deleted file mode 100644 index f7ba75d..0000000 --- a/src/app/Riverside.Elapsed.App/App.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/app/Riverside.Elapsed.App/Assets/Icons/icon.svg b/src/app/Riverside.Elapsed.App/Assets/Icons/icon.svg deleted file mode 100644 index e22094c..0000000 --- a/src/app/Riverside.Elapsed.App/Assets/Icons/icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/app/Riverside.Elapsed.App/Assets/Icons/icon_foreground.svg b/src/app/Riverside.Elapsed.App/Assets/Icons/icon_foreground.svg deleted file mode 100644 index e22094c..0000000 --- a/src/app/Riverside.Elapsed.App/Assets/Icons/icon_foreground.svg +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/app/Riverside.Elapsed.App/Assets/Splash/splash_screen.svg b/src/app/Riverside.Elapsed.App/Assets/Splash/splash_screen.svg deleted file mode 100644 index e22094c..0000000 --- a/src/app/Riverside.Elapsed.App/Assets/Splash/splash_screen.svg +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/app/Riverside.Elapsed.App/ReadMe.md b/src/app/Riverside.Elapsed.App/ReadMe.md deleted file mode 100644 index 93482da..0000000 --- a/src/app/Riverside.Elapsed.App/ReadMe.md +++ /dev/null @@ -1,7 +0,0 @@ -# Getting Started - -Welcome to the Uno Platform! - -To discover how to get started with your new app: https://aka.platform.uno/get-started - -For more information on how to use the Uno.Sdk or upgrade Uno Platform packages in your solution: https://aka.platform.uno/using-uno-sdk \ No newline at end of file diff --git a/src/app/Riverside.Elapsed.App/Views/LoginPage.xaml b/src/app/Riverside.Elapsed.App/Views/LoginPage.xaml deleted file mode 100644 index 1ba0324..0000000 --- a/src/app/Riverside.Elapsed.App/Views/LoginPage.xaml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - -