Skip to content

Commit

Permalink
attempting to get github workflows working for automated deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
CloneDeath committed Aug 23, 2023
1 parent b45bd23 commit e3e351f
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: dotnet build --configuration Release
19 changes: 19 additions & 0 deletions .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9][0-9][0-9]"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --output .
- name: Push
run: dotnet nuget push Godot.LocalResources.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY}
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify commit exists in origin/master
run: git branch --remote --contains | grep origin/master
- name: Extract release notes
run: |
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
- name: Push
run: dotnet nuget push Godot.LocalResources.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY}
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
12 changes: 12 additions & 0 deletions Godot.LocalResources.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Godot.LocalResources", "Godot.LocalResources\Godot.LocalResources.csproj", "{32ABEFCF-8D23-4EDA-8E3B-FA02394A3B9A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{5A1D550C-3DF3-497B-9D28-E4F9A0EB3F95}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{0105EA31-31B4-468C-9435-DE2A4E11F0D7}"
ProjectSection(SolutionItems) = preProject
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\release-preview.yml = .github\workflows\release-preview.yml
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,4 +22,7 @@ Global
{32ABEFCF-8D23-4EDA-8E3B-FA02394A3B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32ABEFCF-8D23-4EDA-8E3B-FA02394A3B9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0105EA31-31B4-468C-9435-DE2A4E11F0D7} = {5A1D550C-3DF3-497B-9D28-E4F9A0EB3F95}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions Godot.LocalResources/Godot.LocalResources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<WarningsAsErrors>True</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<PackageId>Godot.LocalResources</PackageId>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/CloneDeath/Godot.LocalResources</RepositoryUrl>
<PackageLicenseUrl>https://creativecommons.org/publicdomain/zero/1.0/</PackageLicenseUrl>
</PropertyGroup>
<Target Name="PrepareReleaseNotes" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<PackageDescription>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../RELEASE-NOTES"))</PackageDescription>
</PropertyGroup>
</Target>
</Project>
1 change: 1 addition & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit e3e351f

Please sign in to comment.