Compare commits
	
		
			5 Commits
		
	
	
		
			fd0bab1c78
			...
			7e449575ed
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7e449575ed | |||
| 7c556c3bd7 | |||
| e18aacd98b | |||
| b68a65386e | |||
| 3a2fc750a0 | 
							
								
								
									
										26
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					name: CI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  # push:
 | 
				
			||||||
 | 
					  #   branches: [ "master" ]
 | 
				
			||||||
 | 
					  pull_request:
 | 
				
			||||||
 | 
					    branches: [ "master" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  build:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - uses: actions/checkout@v4
 | 
				
			||||||
 | 
					    - name: Setup .NET
 | 
				
			||||||
 | 
					      uses: actions/setup-dotnet@v3
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        dotnet-version: 6.0.x
 | 
				
			||||||
 | 
					    - name: Restore dependencies
 | 
				
			||||||
 | 
					      run: dotnet restore
 | 
				
			||||||
 | 
					    - name: Build
 | 
				
			||||||
 | 
					      run: dotnet build --no-restore
 | 
				
			||||||
 | 
					    # - name: Test
 | 
				
			||||||
 | 
					    #   run: dotnet test --no-build --verbosity normal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										108
									
								
								.gitea/workflows/master.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								.gitea/workflows/master.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,108 @@
 | 
				
			|||||||
 | 
					name: Master Build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  push:
 | 
				
			||||||
 | 
					    branches: [ "master" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  build_amd64:
 | 
				
			||||||
 | 
					    name: Build and Push Docker Image (amd64)
 | 
				
			||||||
 | 
					    runs-on: self-hosted-ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install docker and docker compose
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          apt update
 | 
				
			||||||
 | 
					          apt install -y docker docker-compose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/login-action@v3.3.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          username: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up QEMU
 | 
				
			||||||
 | 
					        uses: docker/setup-qemu-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/setup-buildx-action@v3.8.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Available platforms
 | 
				
			||||||
 | 
					        run: echo ${{ steps.buildx.outputs.platforms }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Build Docker image and push
 | 
				
			||||||
 | 
					        id: docker_build
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/build-push-action@v6.12.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: ./
 | 
				
			||||||
 | 
					          file: ./Dockerfile
 | 
				
			||||||
 | 
					          push: true
 | 
				
			||||||
 | 
					          tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest
 | 
				
			||||||
 | 
					          platforms: linux/amd64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Image digest
 | 
				
			||||||
 | 
					        run: echo ${{ steps.docker_build.outputs.digest }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_arm64:
 | 
				
			||||||
 | 
					    name: Build and Push Docker Image (arm64)
 | 
				
			||||||
 | 
					    runs-on: self-hosted-ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install docker and docker compose
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          apt update
 | 
				
			||||||
 | 
					          apt install -y docker docker-compose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/login-action@v3.3.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          username: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up QEMU
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/setup-qemu-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/setup-buildx-action@v3.8.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Available platforms
 | 
				
			||||||
 | 
					        run: echo ${{ steps.buildx.outputs.platforms }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Build Docker image and push
 | 
				
			||||||
 | 
					        id: docker_build
 | 
				
			||||||
 | 
					        uses: https://github.com/docker/build-push-action@v6.12.0
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: ./
 | 
				
			||||||
 | 
					          file: ./Dockerfile
 | 
				
			||||||
 | 
					          push: true
 | 
				
			||||||
 | 
					          tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest
 | 
				
			||||||
 | 
					          platforms: linux/arm64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Image digest
 | 
				
			||||||
 | 
					        run: echo ${{ steps.docker_build.outputs.digest }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  deploy:
 | 
				
			||||||
 | 
					    name: Update running container
 | 
				
			||||||
 | 
					    runs-on: self-hosted-ubuntu-latest
 | 
				
			||||||
 | 
					    needs: build_arm64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Recreate container
 | 
				
			||||||
 | 
					      uses: https://github.com/appleboy/ssh-action@v1.2.0
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        host: ${{ secrets.HOST }}
 | 
				
			||||||
 | 
					        username: ${{ secrets.USERNAME }}
 | 
				
			||||||
 | 
					        key: ${{ secrets.KEY }}
 | 
				
			||||||
 | 
					        port: ${{ secrets.PORT }}
 | 
				
			||||||
 | 
					        script: |
 | 
				
			||||||
 | 
					          cd docker/kasbot
 | 
				
			||||||
 | 
					          docker compose down
 | 
				
			||||||
 | 
					          docker compose rm
 | 
				
			||||||
 | 
					          docker compose pull
 | 
				
			||||||
 | 
					          docker compose up -d
 | 
				
			||||||
							
								
								
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -16,7 +16,7 @@ jobs:
 | 
				
			|||||||
    - name: Setup .NET
 | 
					    - name: Setup .NET
 | 
				
			||||||
      uses: actions/setup-dotnet@v3
 | 
					      uses: actions/setup-dotnet@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        dotnet-version: 8
 | 
					        dotnet-version: 6.0.x
 | 
				
			||||||
    - name: Restore dependencies
 | 
					    - name: Restore dependencies
 | 
				
			||||||
      run: dotnet restore
 | 
					      run: dotnet restore
 | 
				
			||||||
    - name: Build
 | 
					    - name: Build
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										75
									
								
								.github/workflows/master.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										75
									
								
								.github/workflows/master.yml
									
									
									
									
										vendored
									
									
								
							@@ -5,38 +5,93 @@ on:
 | 
				
			|||||||
    branches: [ "master" ]
 | 
					    branches: [ "master" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  build_multiarch:
 | 
					  build_amd64:
 | 
				
			||||||
    name: Build and Push Docker Image (arm64 and amd64)
 | 
					    name: Build and Push Docker Image (amd64)
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v4
 | 
					      - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Login to Docker Hub
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
        uses: docker/login-action@v3
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          registry: git.ivanch.me
 | 
					 | 
				
			||||||
          username: ${{ secrets.DOCKER_USERNAME }}
 | 
					          username: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
 | 
					          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Set up QEMU
 | 
					      - name: Set up QEMU
 | 
				
			||||||
        uses: docker/setup-qemu-action@v3
 | 
					        uses: docker/setup-qemu-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Set up Docker Buildx
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
        id: buildx
 | 
					        id: buildx
 | 
				
			||||||
        uses: docker/setup-buildx-action@v3
 | 
					        uses: docker/setup-buildx-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Available platforms
 | 
					      - name: Available platforms
 | 
				
			||||||
        run: echo ${{ steps.buildx.outputs.platforms }}
 | 
					        run: echo ${{ steps.buildx.outputs.platforms }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build Docker image and push
 | 
					      - name: Build Docker image and push
 | 
				
			||||||
        id: docker_build
 | 
					        id: docker_build
 | 
				
			||||||
        uses: docker/build-push-action@v5
 | 
					        uses: docker/build-push-action@v2
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          context: ./
 | 
					          context: ./
 | 
				
			||||||
          file: ./Dockerfile
 | 
					          file: ./Dockerfile
 | 
				
			||||||
          push: true
 | 
					          push: true
 | 
				
			||||||
          tags: git.ivanch.me/ivanch/kasbot/kasbot:latest
 | 
					          tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest
 | 
				
			||||||
          platforms: linux/arm64,linux/amd64
 | 
					          platforms: linux/amd64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Image digest
 | 
					      - name: Image digest
 | 
				
			||||||
        run: echo ${{ steps.docker_build.outputs.digest }}
 | 
					        run: echo ${{ steps.docker_build.outputs.digest }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build_arm64:
 | 
				
			||||||
 | 
					    name: Build and Push Docker Image (arm64)
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Login to Docker Hub
 | 
				
			||||||
 | 
					        uses: docker/login-action@v1
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          username: ${{ secrets.DOCKER_USERNAME }}
 | 
				
			||||||
 | 
					          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up QEMU
 | 
				
			||||||
 | 
					        uses: docker/setup-qemu-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        id: buildx
 | 
				
			||||||
 | 
					        uses: docker/setup-buildx-action@v1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Available platforms
 | 
				
			||||||
 | 
					        run: echo ${{ steps.buildx.outputs.platforms }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Build Docker image and push
 | 
				
			||||||
 | 
					        id: docker_build
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v2
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: ./
 | 
				
			||||||
 | 
					          file: ./Dockerfile
 | 
				
			||||||
 | 
					          push: true
 | 
				
			||||||
 | 
					          tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest
 | 
				
			||||||
 | 
					          platforms: linux/arm64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Image digest
 | 
				
			||||||
 | 
					        run: echo ${{ steps.docker_build.outputs.digest }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  deploy:
 | 
				
			||||||
 | 
					    name: Update running container
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    needs: build_arm64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Recreate container
 | 
				
			||||||
 | 
					      uses: appleboy/ssh-action@v0.1.7
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        host: ${{ secrets.HOST }}
 | 
				
			||||||
 | 
					        username: ${{ secrets.USERNAME }}
 | 
				
			||||||
 | 
					        key: ${{ secrets.KEY }}
 | 
				
			||||||
 | 
					        port: ${{ secrets.PORT }}
 | 
				
			||||||
 | 
					        script: |
 | 
				
			||||||
 | 
					          cd docker/kasbot
 | 
				
			||||||
 | 
					          docker-compose down
 | 
				
			||||||
 | 
					          docker-compose rm
 | 
				
			||||||
 | 
					          docker-compose pull
 | 
				
			||||||
 | 
					          docker-compose up -d
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
 | 
					FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
 | 
				
			||||||
WORKDIR /App
 | 
					WORKDIR /App
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Copy everything
 | 
					# Copy everything
 | 
				
			||||||
@@ -14,7 +14,7 @@ RUN dotnet restore
 | 
				
			|||||||
RUN dotnet build -c Release -o out
 | 
					RUN dotnet build -c Release -o out
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build runtime image
 | 
					# Build runtime image
 | 
				
			||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
 | 
					FROM mcr.microsoft.com/dotnet/aspnet:6.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN apt update && apt install -y ffmpeg libopus-dev opus-tools libsodium-dev
 | 
					RUN apt update && apt install -y ffmpeg libopus-dev opus-tools libsodium-dev
 | 
				
			||||||
WORKDIR /App
 | 
					WORKDIR /App
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
 | 
					<Project Sdk="Microsoft.NET.Sdk.Web">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <PropertyGroup>
 | 
					  <PropertyGroup>
 | 
				
			||||||
    <TargetFramework>net8.0</TargetFramework>
 | 
					    <TargetFramework>net6.0</TargetFramework>
 | 
				
			||||||
    <Nullable>enable</Nullable>
 | 
					    <Nullable>enable</Nullable>
 | 
				
			||||||
    <ImplicitUsings>enable</ImplicitUsings>
 | 
					    <ImplicitUsings>enable</ImplicitUsings>
 | 
				
			||||||
    <UserSecretsId>a8c1813f-fb5a-4771-868e-60e280ccaf77</UserSecretsId>
 | 
					    <UserSecretsId>a8c1813f-fb5a-4771-868e-60e280ccaf77</UserSecretsId>
 | 
				
			||||||
@@ -16,7 +16,7 @@
 | 
				
			|||||||
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
 | 
					      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
 | 
				
			||||||
    </PackageReference>
 | 
					    </PackageReference>
 | 
				
			||||||
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
 | 
					    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
 | 
				
			||||||
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
 | 
					    <PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  <PropertyGroup>
 | 
					  <PropertyGroup>
 | 
				
			||||||
    <OutputType>Exe</OutputType>
 | 
					    <OutputType>Exe</OutputType>
 | 
				
			||||||
    <TargetFramework>net8.0</TargetFramework>
 | 
					    <TargetFramework>net6.0</TargetFramework>
 | 
				
			||||||
    <ImplicitUsings>enable</ImplicitUsings>
 | 
					    <ImplicitUsings>enable</ImplicitUsings>
 | 
				
			||||||
    <Nullable>enable</Nullable>
 | 
					    <Nullable>enable</Nullable>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
@@ -14,7 +14,7 @@
 | 
				
			|||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <PackageReference Include="Discord.Net" Version="3.18.0" />
 | 
					    <PackageReference Include="Discord.Net" Version="3.17.1" />
 | 
				
			||||||
    <PackageReference Include="Google.Protobuf" Version="3.25.1" />
 | 
					    <PackageReference Include="Google.Protobuf" Version="3.25.1" />
 | 
				
			||||||
    <PackageReference Include="Grpc.AspNetCore" Version="2.59.0" />
 | 
					    <PackageReference Include="Grpc.AspNetCore" Version="2.59.0" />
 | 
				
			||||||
    <PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
 | 
					    <PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
    <PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
 | 
					    <PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
 | 
				
			||||||
    <PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
 | 
					    <PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
 | 
				
			||||||
    <PackageReference Include="SpotifyAPI.Web" Version="7.2.1" />
 | 
					    <PackageReference Include="SpotifyAPI.Web" Version="7.2.1" />
 | 
				
			||||||
    <PackageReference Include="YoutubeExplode" Version="6.5.4" />
 | 
					    <PackageReference Include="YoutubeExplode" Version="6.5.1" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ItemGroup>
 | 
					    <ItemGroup>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user