Skip to content

Commit 4fd0f43

Browse files
Refactor: Migrate CI to GitHub Actions and add Dependabot
Co-authored-by: erik <[email protected]>
1 parent 1d383e1 commit 4fd0f43

File tree

8 files changed

+293
-42
lines changed

8 files changed

+293
-42
lines changed

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: "nuget"
10+
directory: "/FeedlySharp"
11+
schedule:
12+
interval: "weekly"
13+
open-pull-requests-limit: 10
14+
15+
- package-ecosystem: "nuget"
16+
directory: "/FeedlySharp.Tests"
17+
schedule:
18+
interval: "weekly"
19+
open-pull-requests-limit: 10
20+
21+
- package-ecosystem: "github-actions"
22+
directory: "/"
23+
schedule:
24+
interval: "weekly"

.github/workflows/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains GitHub Actions workflows for CI/CD and package publishing.
4+
5+
## Workflows
6+
7+
### CI (`ci.yml`)
8+
Runs on every push and pull request to main/master/develop branches.
9+
10+
**Features:**
11+
- Builds the project
12+
- Runs all tests
13+
- Uploads test results and coverage reports
14+
- Uses Codecov for coverage reporting
15+
16+
### Pull Request (`pr.yml`)
17+
Runs on pull requests to main/master/develop branches.
18+
19+
**Features:**
20+
- Cross-platform testing (Ubuntu, Windows, macOS)
21+
- Build verification
22+
- Test execution
23+
- Code formatting verification
24+
25+
### Release (`release.yml`)
26+
Publishes NuGet packages when:
27+
- A tag matching `v*.*.*` is pushed (e.g., `v3.0.0`)
28+
- Manual workflow dispatch with version input
29+
30+
**Features:**
31+
- Builds and tests the project
32+
- Creates NuGet package
33+
- Publishes to NuGet.org
34+
- Uploads artifacts
35+
36+
**Required Secrets:**
37+
- `NUGET_API_KEY` - Your NuGet.org API key
38+
39+
### CodeQL Analysis (`codeql.yml`)
40+
Security analysis using GitHub's CodeQL.
41+
42+
**Features:**
43+
- Automated security scanning
44+
- Runs on pushes, PRs, and weekly schedule
45+
- C# code analysis
46+
47+
## Setting Up NuGet Publishing
48+
49+
1. Get your NuGet API key from https://www.nuget.org/account/apikeys
50+
2. Add it as a secret in your GitHub repository:
51+
- Go to Settings → Secrets and variables → Actions
52+
- Click "New repository secret"
53+
- Name: `NUGET_API_KEY`
54+
- Value: Your NuGet API key
55+
3. Create a release tag:
56+
```bash
57+
git tag v3.0.0
58+
git push origin v3.0.0
59+
```
60+
Or use the workflow dispatch feature in the Actions tab.
61+
62+
## Dependabot
63+
64+
Dependabot is configured to automatically update:
65+
- NuGet packages (weekly)
66+
- GitHub Actions (weekly)
67+
68+
See `.github/dependabot.yml` for configuration.

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, develop ]
6+
pull_request:
7+
branches: [ main, master, develop ]
8+
9+
jobs:
10+
build:
11+
name: Build and Test
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
dotnet-version: ['10.0.x']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ matrix.dotnet-version }}
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build --no-restore --configuration Release
32+
33+
- name: Run tests
34+
run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage"
35+
continue-on-error: false
36+
37+
- name: Upload test results
38+
uses: actions/upload-artifact@v4
39+
if: always()
40+
with:
41+
name: test-results-${{ matrix.dotnet-version }}
42+
path: '**/test-results.trx'
43+
44+
- name: Upload coverage reports
45+
uses: codecov/codecov-action@v4
46+
if: always()
47+
with:
48+
files: '**/coverage.cobertura.xml'
49+
fail_ci_if_error: false

.github/workflows/codeql.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CodeQL Analysis
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
schedule:
9+
- cron: '0 0 * * 0' # Weekly on Sunday
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ 'csharp' ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '10.0.x'
38+
39+
- name: Restore dependencies
40+
run: dotnet restore
41+
42+
- name: Build
43+
run: dotnet build --no-restore --configuration Release
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3

.github/workflows/pr.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master, develop ]
6+
7+
jobs:
8+
build:
9+
name: Build and Test
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
dotnet-version: ['10.0.x']
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: ${{ matrix.dotnet-version }}
25+
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --no-restore --configuration Release
31+
32+
- name: Run tests
33+
run: dotnet test --no-build --configuration Release --verbosity normal
34+
35+
- name: Check code formatting
36+
run: dotnet format --verify-no-changes --verbosity diagnostic

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to publish (e.g., 3.0.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
build-and-publish:
16+
name: Build and Publish to NuGet
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: '10.0.x'
30+
31+
- name: Determine version
32+
id: version
33+
run: |
34+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
35+
VERSION="${{ github.event.inputs.version }}"
36+
else
37+
VERSION=${GITHUB_REF#refs/tags/v}
38+
fi
39+
echo "version=$VERSION" >> $GITHUB_OUTPUT
40+
echo "Determined version: $VERSION"
41+
42+
- name: Restore dependencies
43+
run: dotnet restore
44+
45+
- name: Build
46+
run: dotnet build --no-restore --configuration Release -p:Version=${{ steps.version.outputs.version }}
47+
48+
- name: Run tests
49+
run: dotnet test --no-build --configuration Release --verbosity normal
50+
51+
- name: Pack
52+
run: dotnet pack FeedlySharp/FeedlySharp.csproj --no-build --configuration Release -p:Version=${{ steps.version.outputs.version }} -p:PackageVersion=${{ steps.version.outputs.version }} --output ./artifacts
53+
54+
- name: Publish to NuGet
55+
env:
56+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
57+
run: |
58+
if [ -z "$NUGET_API_KEY" ]; then
59+
echo "NUGET_API_KEY secret is not set. Skipping NuGet publish."
60+
exit 0
61+
fi
62+
dotnet nuget push ./artifacts/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
63+
64+
- name: Upload artifacts
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: nuget-packages
68+
path: ./artifacts/*.nupkg
69+
retention-days: 30

azure-pipelines.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
![FeedlySharp](https://raw.githubusercontent.com/Zettersten/FeedlySharp/master/FeedlySharp/feedly.png "FeedlySharp")
22
# FeedlySharp
33

4-
![Build history](https://buildstats.info/azurepipelines/chart/nenvy/FeedlySharp/8)
5-
64
A high-performance, thread-safe HTTP Client for the Feedly Cloud API, built with .NET 10, source generators, and AOT support. Millions of users depend on their feedly for inspiration, information, and to feed their passions. But one size does not fit all. Individuals have different workflows, different habits, and different devices. In our efforts to evolve feedly from a product to a platform, we have therefore decided to open up the feedly API. Developers are welcome to deliver new applications, experiences, and innovations via the feedly cloud. We feel strongly that this will help to accelerate innovation and better serve our users.
75

8-
[![Build Status](https://dev.azure.com/nenvy/FeedlySharp/_apis/build/status/Zettersten.FeedlySharp?branchName=master)](https://dev.azure.com/nenvy/FeedlySharp/_build/latest?definitionId=8&branchName=master) [![NuGet Badge](https://buildstats.info/nuget/FeedlySharp)](https://www.nuget.org/packages/FeedlySharp/)
6+
[![CI](https://github.com/Zettersten/FeedlySharp/workflows/CI/badge.svg)](https://github.com/Zettersten/FeedlySharp/actions/workflows/ci.yml) [![NuGet Badge](https://buildstats.info/nuget/FeedlySharp)](https://www.nuget.org/packages/FeedlySharp/) [![NuGet Version](https://img.shields.io/nuget/v/FeedlySharp.svg)](https://www.nuget.org/packages/FeedlySharp/)
97

108
## Features
119

0 commit comments

Comments
 (0)