Skip to content

Commit

Permalink
Merge pull request #383 from drewnoakes/github-ci
Browse files Browse the repository at this point in the history
Add GitHub CI workflow
  • Loading branch information
drewnoakes authored Jan 29, 2024
2 parents 1aafb4b + a998e73 commit 5664056
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 47 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:

push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

ununtu:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore MetadataExtractor.sln
- name: Build (Release)
run: dotnet build MetadataExtractor.sln --configuration Release
- name: Build (Debug)
run: dotnet build MetadataExtractor.sln --configuration Debug
- name: Test net8.0 (Release)
run: dotnet test --verbosity normal --configuration Release --no-build -f net8.0 MetadataExtractor.Tests/MetadataExtractor.Tests.csproj
- name: Test net8.0 (Debug)
run: dotnet test --verbosity normal --configuration Debug --no-build -f net8.0 MetadataExtractor.Tests/MetadataExtractor.Tests.csproj

windows:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore MetadataExtractor.sln
- name: Build
run: dotnet build MetadataExtractor.sln --configuration Release
- name: Test net8.0
run: dotnet test --verbosity normal --configuration Release --no-build -f net8.0 MetadataExtractor.Tests\MetadataExtractor.Tests.csproj
- name: Test net462
run: dotnet test --verbosity normal --configuration Release --no-build -f net462 MetadataExtractor.Tests\MetadataExtractor.Tests.csproj
22 changes: 22 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: prerelease
on:
release:
types: [prereleased]

jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- run: echo ${{ steps.get_version.outputs.VERSION }}
- run: dotnet pack MetadataExtractor/MetadataExtractor.csproj -o . -c Release /p:Version=${{ steps.get_version.outputs.VERSION }} /p:ContinuousIntegrationBuild=true
- run: dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NuGetAPIKey }}
shell: bash


23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release
on:
release:
types: [published]

jobs:
windows:
runs-on: windows-latest
if: "!github.event.release.prerelease"
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- run: echo ${{ steps.get_version.outputs.VERSION }}
- run: dotnet pack MetadataExtractor/MetadataExtractor.csproj -o . -c Release /p:Version=${{ steps.get_version.outputs.VERSION }} /p:ContinuousIntegrationBuild=true
- run: dotnet nuget push *.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NuGetAPIKey }}
shell: bash


13 changes: 11 additions & 2 deletions MetadataExtractor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.gitattributes = .gitattributes
.gitignore = .gitignore
.gitmodules = .gitmodules
appveyor.yml = appveyor.yml
azure-pipelines.yml = azure-pipelines.yml
Build.ps1 = Build.ps1
CONTRIBUTING.md = CONTRIBUTING.md
Directory.Build.props = Directory.Build.props
Expand Down Expand Up @@ -101,6 +99,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wiki (Images)", "Wiki (Imag
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MetadataExtractor.Samples", "MetadataExtractor.Samples\MetadataExtractor.Samples.csproj", "{F8B15C79-7D2A-44F2-9E8A-1D5127FE6D91}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{2980D6CD-F063-461C-A8F6-AB90D505FA8C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{D75F7643-9F42-4A6B-A3FF-92443537CE9D}"
ProjectSection(SolutionItems) = preProject
.github\workflows\CI.yml = .github\workflows\CI.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -169,6 +174,10 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2980D6CD-F063-461C-A8F6-AB90D505FA8C} = {8CF154EA-6A2C-4BF4-B263-78758F834192}
{D75F7643-9F42-4A6B-A3FF-92443537CE9D} = {2980D6CD-F063-461C-A8F6-AB90D505FA8C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {15F8CDD5-5EFF-4277-8559-5AA83D1353C8}
EndGlobalSection
Expand Down
45 changes: 0 additions & 45 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit 5664056

Please sign in to comment.