Skip to content

Commit

Permalink
add github action;
Browse files Browse the repository at this point in the history
  • Loading branch information
lif0 committed Jan 1, 2024
1 parent d15144c commit 6af23c1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
49 changes: 49 additions & 0 deletions .github/workflows/github-actions-push-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Publish to NuGet"

on:
push:
tags:
- 'v*'

env:
PROJECT_PATH: 'src'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

jobs:
deploy:
name: 'Publish nuget'
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '6.x.x' ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Display dotnet version
run: dotnet --version

- name: Restore packages
run: dotnet restore ${{ env.PROJECT_PATH }}

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

- name: Get Version
id: version
uses: battila7/get-version-action@v2

- run: echo ${{ steps.get_version.outputs.version-without-v }}

- name: Pack project
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: Publish package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
1 change: 0 additions & 1 deletion src/FabulousScheduler.Core/FabulousScheduler.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<IsPackable>true</IsPackable>
<Version>2.1.2</Version>
<PackageIcon>icon.jpeg</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
1 change: 0 additions & 1 deletion src/FabulousScheduler.Cron/FabulousScheduler.Cron.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<IsPackable>true</IsPackable>
<Version>2.1.2</Version>
<PackageIcon>icon.jpeg</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
1 change: 0 additions & 1 deletion src/FabulousScheduler.Queue/FabulousScheduler.Queue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<IsPackable>true</IsPackable>
<Version>2.1.2</Version>
<PackageIcon>icon.jpeg</PackageIcon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down

0 comments on commit 6af23c1

Please sign in to comment.