Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto workflow improvement #96

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/ProjBobcat/ProjBobcat" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
43 changes: 43 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Pre-Release Version NuGet Package

on:
push:
branches: [master]
jobs:
test-build:
name: Test build on ${{ matrix.os }} .NET 8.0
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Build Test
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
publish-package:
name: Publish package
runs-on: windows-latest
needs: [test-build]
if: needs.test-build.result == 'success'
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Get Current Time
id: current-time
uses: josStorer/[email protected]
with:
format: YYYYMMDD-HHmmss
utcOffset: "+08:00"
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Create the package
run: dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion=beta-${{ steps.current-time.outputs.formattedTime }}-${{github.sha}}"
- name: Publish the package to NuGet.org
run: dotnet nuget push -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json "ProjBobcat/ProjBobcat/bin/Release/*.nupkg"
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Release Version NuGet Package

on:
release:
types: [published]
jobs:
test-build:
name: Test build on ${{ matrix.os }} .NET 8.0
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Build Test
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
publish-package:
name: Publish package
runs-on: windows-latest
needs: [test-build]
if: needs.test-build.result == 'success'
steps:
- uses: actions/[email protected]
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Create the package
run: dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion=${{ github.ref }}
- name: Publish the package to NuGet.org
run: dotnet nuget push -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json "ProjBobcat/ProjBobcat/bin/Release/*.nupkg"
3 changes: 1 addition & 2 deletions ProjBobcat/ProjBobcat/ProjBobcat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>Bobcat.png</PackageIcon>
<RepositoryUrl>https://github.com/Corona-Studio/ProjBobcat</RepositoryUrl>
<Version>1.40.0</Version>
<Authors>Corona Studio</Authors>
<Company>Corona Studio</Company>
<Product>ProjBobcat</Product>
Expand Down Expand Up @@ -122,4 +121,4 @@ resolved the issue that LaunchWrapper may not return the correct exit code
<Compile Include="Platforms\MacOS\**\*.cs" />
</ItemGroup>
<!-- Compile Options -->
</Project>
</Project>
Loading