-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
106 additions
and
41 deletions.
There are no files selected for viewing
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,10 +1,6 @@ | ||
name: .NET | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
on: [ push, pull_request ] | ||
|
||
env: | ||
DOTNET_SDK_VERSION: 5.0.x | ||
|
@@ -30,11 +26,19 @@ jobs: | |
- name: Build with .NET Framework | ||
run: dotnet publish -c Release -f net48 -o out/generic-netf | ||
|
||
- name: Archive generic-netf release | ||
uses: thedoctor0/zip-release@master | ||
with: | ||
directory: out/generic | ||
type: 'zip' | ||
filename: 'out/generic.zip' | ||
exclusions: '*.json' | ||
|
||
- name: Upload generic-netf artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.event.repository.name }}-generic-netf | ||
path: out/generic-netf | ||
path: out/generic-netf.zip | ||
|
||
build-generic: | ||
runs-on: windows-latest | ||
|
@@ -56,11 +60,19 @@ jobs: | |
- name: Build with .NET Core | ||
run: dotnet publish -c Release -f net5.0 -o out/generic | ||
|
||
- name: Archive generic release | ||
uses: thedoctor0/zip-release@master | ||
with: | ||
directory: out/generic | ||
type: 'zip' | ||
filename: 'out/generic.zip' | ||
exclusions: '*.json' | ||
|
||
- name: Upload generic artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.event.repository.name }}-generic | ||
path: out/generic | ||
path: out/generic.zip | ||
|
||
release: | ||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | ||
|
@@ -88,7 +100,6 @@ jobs: | |
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.event.repository.name }} V${{ github.ref }} | ||
prerelease: true | ||
|
||
- name: Upload generic artifacts to GitHub release | ||
uses: actions/[email protected] | ||
|
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,17 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<ApplicationIcon/> | ||
<Authors>Vital7</Authors> | ||
<Company>$(Authors)</Company> | ||
<Copyright>Copyright © $(Company) 2020-$([System.DateTime]::UtcNow.Year)</Copyright> | ||
<PackageIcon/> | ||
<PackageProjectUrl>https://github.com/$(Company)/$(MSBuildProjectName)</PackageProjectUrl> | ||
<PackageReleaseNotes>$(PackageProjectUrl)/releases</PackageReleaseNotes> | ||
<PublicSign>false</PublicSign> | ||
<OutputType>Library</OutputType> | ||
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl> | ||
<SignAssembly>false</SignAssembly> | ||
</PropertyGroup> | ||
|
||
</Project> |
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,7 @@ | ||
<Project> | ||
<ItemGroup Condition="'$(TargetFramework)' == 'net48'"> | ||
<PackageVersion Include="IndexRange" Version="1.0.0"/> | ||
</ItemGroup> | ||
|
||
<Import Project="ArchiSteamFarm/Directory.Packages.props" /> | ||
</Project> |
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,3 @@ | ||
using System; | ||
|
||
[assembly: CLSCompliant(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,12 @@ | ||
<Project> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../ArchiSteamFarm/'))"/> | ||
|
||
<PropertyGroup> | ||
<Description>Simple ASF plugin for accepting all friend invites.</Description> | ||
<Version>2.0.0.0</Version> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/> | ||
|
||
</Project> |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Nullable>enable</Nullable> | ||
<TargetFrameworks>net5.0;net48</TargetFrameworks> | ||
<LangVersion>latest</LangVersion> | ||
<Version>1.1.1.0</Version> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="JetBrains.Annotations" Version="*" IncludeAssets="compile" /> | ||
<PackageReference Include="System.Composition.AttributedModel" Version="*" IncludeAssets="compile" /> | ||
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm\ArchiSteamFarm.csproj" Private="false" ExcludeAssets="all" /> | ||
<PackageReference Include="JetBrains.Annotations" IncludeAssets="compile"/> | ||
<PackageReference Include="System.Composition.AttributedModel" IncludeAssets="compile"/> | ||
<ProjectReference Include="..\ArchiSteamFarm\ArchiSteamFarm\ArchiSteamFarm.csproj" Private="false" ExcludeAssets="all"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net48'"> | ||
<PackageReference Include="IndexRange" IncludeAssets="compile"/> | ||
</ItemGroup> | ||
|
||
</Project> |
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,40 @@ | ||
using System; | ||
using System.Composition; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Threading.Tasks; | ||
using ArchiSteamFarm.Core; | ||
using ArchiSteamFarm.Plugins.Interfaces; | ||
using ArchiSteamFarm.Steam; | ||
using JetBrains.Annotations; | ||
|
||
namespace FriendAccepter { | ||
[Export(typeof(IPlugin))] | ||
[UsedImplicitly] | ||
public class FriendAccepterPlugin : IBotFriendRequest { | ||
public void OnLoaded() { | ||
Assembly assembly = Assembly.GetExecutingAssembly(); | ||
string repository = assembly | ||
.GetCustomAttributes<AssemblyMetadataAttribute>() | ||
.First(x => x.Key == "RepositoryUrl") | ||
.Value ?? throw new InvalidOperationException(nameof(AssemblyMetadataAttribute)); | ||
|
||
const string git = ".git"; | ||
int index = repository.IndexOf(git, StringComparison.Ordinal); | ||
if (index >= 0) { | ||
repository = repository[..(index + 1)]; | ||
} | ||
|
||
string company = assembly | ||
.GetCustomAttribute<AssemblyCompanyAttribute>()?.Company ?? throw new InvalidOperationException(nameof(AssemblyCompanyAttribute)); | ||
|
||
ASF.ArchiLogger.LogGenericInfo(Name + " by " + company + " | Support & source code: " + repository); | ||
} | ||
|
||
public string Name => nameof(FriendAccepter); | ||
public Version Version => Assembly.GetExecutingAssembly().GetName().Version ?? throw new InvalidOperationException(nameof(Version)); | ||
|
||
[CLSCompliant(false)] | ||
public Task<bool> OnBotFriendRequest(Bot bot, ulong steamID) => Task.FromResult(true); | ||
} | ||
} |