Skip to content

Commit 0e8d64d

Browse files
committedNov 27, 2021
Updated to .NET 6 and improved Actions Workflows
1 parent 8983cc5 commit 0e8d64d

File tree

4 files changed

+46
-87
lines changed

4 files changed

+46
-87
lines changed
 

‎.github/workflows/codeql-analysis.yml

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
1+
# Action Name
12
name: "CodeQL"
23

4+
# When the Action will Run
35
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
86
schedule:
9-
- cron: '41 2 * * 3'
7+
- cron: '0 7 * * 5'
108

9+
# Workflow Jobs
1110
jobs:
11+
# Analyze Job
1212
analyze:
1313
name: Analyze
1414
runs-on: ubuntu-latest
15+
1516
permissions:
1617
actions: read
1718
contents: read
1819
security-events: write
1920

20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
language: [ 'csharp' ]
24-
2521
steps:
26-
- name: Checkout repository
27-
uses: actions/checkout@v2
28-
29-
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v1
31-
with:
32-
languages: ${{ matrix.language }}
33-
34-
- name: Autobuild
35-
uses: github/codeql-action/autobuild@v1
36-
37-
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@v1
22+
# Step 1 - Checkout Code
23+
- name: Checkout Code
24+
uses: actions/checkout@v2
25+
26+
# Step 2 - Initialize CodeQL
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v1
29+
with:
30+
languages: csharp
31+
queries: security-and-quality
32+
33+
# Step 3 - Setup .NET 6 with GitHub Packages Authentication
34+
- name: Setup .NET 6 with GitHub Packages Authentication
35+
uses: actions/setup-dotnet@v1
36+
with:
37+
dotnet-version: 6.0.x
38+
source-url: https://nuget.pkg.github.com/ricado-group/index.json
39+
env:
40+
NUGET_AUTH_TOKEN: ${{ secrets.GH_ACTIONS_PAT }}
41+
42+
# Step 4 - Build the Library
43+
- name: Run CodeQL Autobuild
44+
uses: github/codeql-action/autobuild@v1
45+
46+
# Step 5 - Perform CodeQL Analysis
47+
- name: Perform CodeQL Analysis
48+
uses: github/codeql-action/analyze@v1

‎.github/workflows/main.yml

+10-61
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Action Name
22
name: Main Automated Builds
33

4-
# Environment Variables
5-
env:
6-
PROJECT_NAME: "RICADO.Modbus"
7-
8-
# Controls when the action will run.
4+
# When the Action will Run
95
on:
106
push:
117
branches:
@@ -15,67 +11,20 @@ on:
1511

1612
# Workflow Jobs
1713
jobs:
18-
# Build Job
1914
build:
2015
runs-on: ubuntu-latest
2116
steps:
2217
# Step 1 - Checkout Code
2318
- name: Checkout Code
2419
uses: actions/checkout@v2
2520

26-
# Step 2 - Extract Environment Variables
27-
- name: Extract Environment Variables
28-
uses: FranzDiebold/github-env-vars-action@v2.3.0
29-
30-
# Step 3 - Setup .NET 5 with GitHub Packages Authentication
31-
- name: Setup .NET 5 with GitHub Packages Authentication
32-
uses: actions/setup-dotnet@v1
33-
with:
34-
dotnet-version: '5.0.100'
35-
source-url: https://nuget.pkg.github.com/ricado-group/index.json
36-
env:
37-
NUGET_AUTH_TOKEN: ${{ secrets.GH_ACTIONS_PAT }}
38-
39-
# Step 4 - Restore NuGet Packages
40-
- name: Restore NuGet Packages
41-
run: dotnet restore "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj"
42-
43-
# Step 5 - Build the Library
44-
- name: Build the Library
45-
run: dotnet build "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj" -c Release
46-
47-
# Step 6 - Pack the Library
48-
- name: Pack the Library
49-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
50-
run: dotnet pack "${{ env.PROJECT_NAME}}/${{ env.PROJECT_NAME }}.csproj" -c Release -p:PackageVersion=${{ env.CI_REF_NAME }}
51-
52-
# Step 7 - Push the Package to GitHub Packages
53-
- name: Push the Package to GitHub Packages
54-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
55-
run: dotnet nuget push "${{ env.PROJECT_NAME }}/bin/Release/*.nupkg" -k ${{ secrets.GH_ACTIONS_PAT }} -s "https://nuget.pkg.github.com/ricado-group/index.json" --skip-duplicate
56-
57-
# Step 8 - Push the Package to NuGet
58-
- name: Push the Package to Nuget
59-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
60-
run: dotnet nuget push "${{ env.PROJECT_NAME }}/bin/Release/*.nupkg" -k ${{ secrets.NUGET_APIKEY }} -s "https://api.nuget.org/v3/index.json" --skip-duplicate
61-
62-
# Step 9 - Generate the Changelog
63-
- name: Generate the Changelog
64-
id: changelog
65-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
66-
uses: metcalfc/changelog-generator@v3.0.0
67-
with:
68-
myToken: ${{ secrets.GITHUB_TOKEN }}
69-
70-
# Step 10 - Create New Release
71-
- name: Create New Release
72-
id: create-release
73-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
74-
uses: actions/create-release@v1
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
# Step 2 - Build and Publish
22+
- name: Build and Publish
23+
uses: ricado-group/dotnet-library-build-release-action@v1.2
7724
with:
78-
tag_name: ${{ env.CI_REF_NAME }}
79-
release_name: Version ${{ env.CI_REF_NAME }}
80-
body: |
81-
${{ steps.changelog.outputs.changelog }}
25+
project-name: 'RICADO.Modbus'
26+
github-token: ${{ secrets.GITHUB_TOKEN }}
27+
private-nuget-url: 'https://nuget.pkg.github.com/ricado-group/index.json'
28+
private-nuget-token: ${{ secrets.GH_ACTIONS_PAT }}
29+
public-nuget-token: ${{ secrets.NUGET_APIKEY }}
30+
publish-public: true

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# RICADO.Modbus
2-
A Modbus Communication Library for .NET 5 Applications
2+
A Modbus Communication Library for .NET 6 Applications
33

44

55
## Sample usage

‎RICADO.Modbus/RICADO.Modbus.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<Authors>RICADO Group</Authors>
66
<Company>RICADO Group LP</Company>
7-
<Description>A Modbus Communication Library for .NET 5 Applications</Description>
7+
<Description>A Modbus Communication Library for .NET 6 Applications</Description>
88
<Copyright>Copyright © RICADO Group LP 2009 - 2021</Copyright>
99
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1010
<PackageIcon>packageIcon.png</PackageIcon>

0 commit comments

Comments
 (0)
Please sign in to comment.