-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from sentry-demos/main
Leaderboard changes from demo
- Loading branch information
Showing
30 changed files
with
436 additions
and
194 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: .NET Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: install wasm workload (macOS) | ||
if: matrix.os == 'macos-latest' | ||
run: sudo dotnet workload install wasm-tools | ||
|
||
- name: install wasm workload (Windows/Linux) | ||
if: matrix.os != 'macos-latest' | ||
run: dotnet workload install wasm-tools | ||
|
||
- run: dotnet build -c Release | ||
|
||
- name: publish Web app | ||
run: dotnet publish Sentaur.Leaderboard.Web -c Release -o webapp | ||
|
||
- name: upload web app to artifact | ||
uses: actions/upload-artifact@v4 | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
name: webapp | ||
if-no-files-found: error | ||
retention-days: 10 | ||
path: | | ||
${{ github.workspace }}/webapp/ | ||
deploy: | ||
needs: build | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
contents: read | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download a single artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: webapp | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'wwwroot' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# game-leaderboard | ||
# Leaderboard for Sentaur Survivors | ||
|
||
[https://sentaur-survivor.com/](https://sentaur-survivor.com/) | ||
|
||
 |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"Sentry": { | ||
"EnableTracing": true, | ||
"Debug": true | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.IdentityModel.Tokens.Jwt; | ||
using System.Text; | ||
using Microsoft.IdentityModel.Tokens; | ||
|
||
namespace Sentaur.Leaderboard.Api; | ||
|
||
public class JwtTokenHolder | ||
{ | ||
public string Token { get; } | ||
|
||
public JwtTokenHolder(WebApplicationBuilder builder) | ||
{ | ||
var issuer = builder.Configuration["Jwt:Issuer"]; | ||
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"] ?? throw new InvalidOperationException("Failed to get 'Jwt:Key'"))); | ||
var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256); | ||
|
||
var token = new JwtSecurityToken(issuer: issuer, signingCredentials: credentials); | ||
Token = new JwtSecurityTokenHandler().WriteToken(token); | ||
} | ||
} |
This file contains 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
47 changes: 0 additions & 47 deletions
47
Sentaur.Leaderboard.Api/Migrations/20240301161657_InitialCreate.Designer.cs
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
Sentaur.Leaderboard.Api/Migrations/20240301164227_NewKeyProp.cs
This file was deleted.
Oops, something went wrong.
23 changes: 14 additions & 9 deletions
23
...ons/20240301164227_NewKeyProp.Designer.cs → ...igrations/20240314033003_Init.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.