Skip to content

Commit

Permalink
Add github action files.
Browse files Browse the repository at this point in the history
  • Loading branch information
inversionhourglass committed Oct 10, 2024
1 parent 98dd417 commit f061550
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Prerelease NuGets
on:
push:
branches:
- prerelease
env:
TIMESTAMP: $(date +'%s')
SOLUTION: Pooling.sln
jobs:
publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 8.0.x

- name: Remove Samples
run: dotnet sln ${{ env.SOLUTION }} remove $(find samples -name "*.csproj")

- name: Restore NuGets
run: dotnet restore ${{ env.SOLUTION }}

- name: Build Solution
run: dotnet build --configuration Release --no-restore ${{ env.SOLUTION }} --version-suffix preview-${{ env.TIMESTAMP }}

- name: Delete exists packages
run: rm -r -fo nugets

- name: Pack Solution
run: dotnet pack ${{ env.SOLUTION }} --configuration Release --no-build --version-suffix preview-${{ env.TIMESTAMP }}

- name: Publish
run: dotnet nuget push nugets/**.nupkg -k ${{ secrets.API_KEY }} -s https://api.nuget.org/v3/index.json
42 changes: 42 additions & 0 deletions .github/workflows/publish-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Release NuGets on tag
on:
push:
tags:
- '*'
env:
SOLUTION: Pooling.sln
jobs:
publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 8.0.x

- name: Remove Samples
run: dotnet sln ${{ env.SOLUTION }} remove $(find samples -name "*.csproj")

- name: Restore NuGets
run: dotnet restore ${{ env.SOLUTION }}

- name: Build Solution
run: dotnet build --configuration Release --no-restore ${{ env.SOLUTION }}

- name: Delete exists packages
run: rm -r -fo nugets

- name: Pack NuGets
run: dotnet pack ${{ env.SOLUTION }} --no-build --configuration Release

- name: Publish
run: dotnet nuget push nugets/**.nupkg -k ${{ secrets.API_KEY }} -s https://api.nuget.org/v3/index.json

- name: Create github release
uses: ncipollo/release-action@v1
with:
bodyFile: CHANGELOG.md
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
on:
push:
branches:
- master
paths:
- 'src/**'
- 'test/**'
- '.github/workflows/**'
env:
SOLUTION: Fody.Cli.sln
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 8.0.x

- name: Remove Samples
run: dotnet sln ${{ env.SOLUTION }} remove $(find samples -name "*.csproj")

- name: Restore NuGets
run: dotnet restore ${{ env.SOLUTION }}

- name: Build Solution in RELEASE
run: dotnet build --configuration Release --no-restore ${{ env.SOLUTION }}

0 comments on commit f061550

Please sign in to comment.