Skip to content

Commit

Permalink
Add pack and publish github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Aug 18, 2024
1 parent 1165851 commit 30fe8d8
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 2,664 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_Build --host GitHubActions
# nuke --generate-configuration GitHubActions_build --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Build
name: build

on: [push]

Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_pack --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: pack

on: [workflow_dispatch]

jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Run: Pack'
run: ./build.cmd Pack
- name: 'Publish: packages'
uses: actions/upload-artifact@v3
with:
name: packages
path: artifacts/packages
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_publish --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: publish

on: [workflow_dispatch]

jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Run: Publish'
run: ./build.cmd Publish
- name: 'Publish: dist'
uses: actions/upload-artifact@v3
with:
name: dist
path: artifacts/dist
16 changes: 15 additions & 1 deletion build/Build.CI.GithubActions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
using Nuke.Common.CI.GitHubActions;

[GitHubActions(
"Build",
"build",
GitHubActionsImage.UbuntuLatest,
On = new[] { GitHubActionsTrigger.Push },
InvokedTargets = new[] { nameof(Compile) }
)]
[GitHubActions(
"pack",
GitHubActionsImage.UbuntuLatest,
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
InvokedTargets = new[] { nameof(Pack) },
FetchDepth = 0
)]
[GitHubActions(
"publish",
GitHubActionsImage.UbuntuLatest,
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
InvokedTargets = new[] { nameof(Publish) },
FetchDepth = 0
)]
partial class Build;
4 changes: 4 additions & 0 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
<PackageDownload Include="minver-cli" Version="[5.0.0]" />
</ItemGroup>

<ItemGroup>
<Folder Include="ci\" />
</ItemGroup>

</Project>
Loading

0 comments on commit 30fe8d8

Please sign in to comment.