Skip to content

Commit

Permalink
Added GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuclearistt committed Jan 12, 2024
1 parent a672d95 commit 1f1fa08
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and upload snapshot package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-package:
name: Build and upload snapshot package
permissions:
packages: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create NuGet Package
run: dotnet pack
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: TEKSteamClient.nupkg
path: 'bin/Release/*.*upkg'
- name: Publish to GitHub Packages
run: dotnet nuget push bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/Nuclearistt/index.json
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish release package

on:
release:
types: [ published ]

permissions:
contents: write
packages: write

jobs:
publish-nupkg:
name: Publish NuGet package

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Create NuGet Package
run: dotnet pack /p:Version=${{ github.event.release.name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: 'TEKSteamClient.${{ github.event.release.name }}.nupkg'
path: 'bin/Release/TEKSteamClient.${{ github.event.release.name }}.*upkg'
- name: Upload to GitHub release
uses: softprops/action-gh-release@v1
with:
files: 'bin/Release/TEKSteamClient.${{ github.event.release.name }}.*upkg'
- name: Publish to NuGet
run: dotnet nuget push bin/Release/TEKSteamClient.${{ github.event.release.name }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish to GitHub Packages
run: dotnet nuget push bin/Release/TEKSteamClient.${{ github.event.release.name }}.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/Nuclearistt/index.json
4 changes: 3 additions & 1 deletion TEKSteamClient.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.1.0</Version>
<BaseVersion>1.1.0</BaseVersion>
<Version>$(BaseVersion)</Version>
<Version Condition="'$(GITHUB_RUN_NUMBER)' != ''">$(BaseVersion)-alpha.$(GITHUB_RUN_NUMBER)</Version>
<Authors>Nuclearist</Authors>
<Product>TEK Steam Client library</Product>
<Title>TEK Steam Client</Title>
Expand Down

0 comments on commit 1f1fa08

Please sign in to comment.