Skip to content

Commit

Permalink
feat: add first pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-muscatello-zupit committed Feb 7, 2024
1 parent 0bbc6b6 commit 5f5f09c
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 49 deletions.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions .github/workflows/release-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release common workflow

on:
workflow_call:
inputs:
WORKING_DIRECTORY:
required: true
type: string
PROJECT:
required: true
type: string
DOTNET_IMAGE:
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
container:
image: ${{ inputs.DOTNET_IMAGE }}
defaults:
run:
working-directory: ${{ inputs.WORKING_DIRECTORY }}

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

- name: Run tests
run: dotnet test

- name: Create NuGet package
run: dotnet pack -c Release -o ./artifacts/${{ inputs.PROJECT }} ${{ inputs.PROJECT }}

- name: Publish NuGet package
run: dotnet nuget push ./artifacts/${{ inputs.PROJECT }}/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.ZUPIT_NUGET_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/release-version-endpoint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release version endpoint workflow

on:
push:
branches:
- main
- release/**
paths:
- Zupit.VersionEndpoint/**
workflow_dispatch:

jobs:
release-version-endpoint:
uses: ./.github/workflows/release-common.yml
with:
DOTNET_IMAGE: 'mcr.microsoft.com/dotnet/sdk:8.0.101-alpine3.18-amd64'
WORKING_DIRECTORY: Zupit.VersionEndpoint
PROJECT: Zupit.VersionEndpoint
secrets: inherit
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions Zupit.DotNet/Zupit.DotNet.sln

This file was deleted.

7 changes: 0 additions & 7 deletions Zupit.DotNet/global.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net7.0": {
"net8.0": {
"Microsoft.AspNetCore.OpenApi": {
"type": "Direct",
"requested": "[7.0.15, )",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public async Task ShouldReturnVersion()
response.EnsureSuccessStatusCode();
var responseContent = await response.Content.ReadAsStringAsync();

Assert.Equal("2.11.1.102", responseContent);
Assert.Equal("15.0.0.0", responseContent);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net7.0": {
"net8.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.2.0, )",
Expand Down Expand Up @@ -1376,7 +1376,7 @@
"dependencies": {
"Microsoft.AspNetCore.OpenApi": "[7.0.15, )",
"Swashbuckle.AspNetCore": "[6.5.0, )",
"Zupit.VersionEndpoint": "[1.0.0, )"
"Zupit.VersionEndpoint": "[0.0.2-alpha, )"
}
}
}
Expand Down
28 changes: 28 additions & 0 deletions Zupit.VersionEndpoint/Zupit.VersionEndpoint.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zupit.VersionEndpoint", "Zupit.VersionEndpoint\Zupit.VersionEndpoint.csproj", "{66278BB8-9CC0-4B84-89FA-9D03EBF2449F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zupit.VersionEndpoint.TestApp", "Zupit.VersionEndpoint.TestApp\Zupit.VersionEndpoint.TestApp.csproj", "{F9AF1980-0A3A-4FA0-8337-1950BCF0D34C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zupit.VersionEndpoint.Tests", "Zupit.VersionEndpoint.Tests\Zupit.VersionEndpoint.Tests.csproj", "{B6033ACB-A106-488F-94E5-FC5F72E5610D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{66278BB8-9CC0-4B84-89FA-9D03EBF2449F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66278BB8-9CC0-4B84-89FA-9D03EBF2449F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66278BB8-9CC0-4B84-89FA-9D03EBF2449F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66278BB8-9CC0-4B84-89FA-9D03EBF2449F}.Release|Any CPU.Build.0 = Release|Any CPU
{F9AF1980-0A3A-4FA0-8337-1950BCF0D34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9AF1980-0A3A-4FA0-8337-1950BCF0D34C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9AF1980-0A3A-4FA0-8337-1950BCF0D34C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9AF1980-0A3A-4FA0-8337-1950BCF0D34C}.Release|Any CPU.Build.0 = Release|Any CPU
{B6033ACB-A106-488F-94E5-FC5F72E5610D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6033ACB-A106-488F-94E5-FC5F72E5610D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6033ACB-A106-488F-94E5-FC5F72E5610D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6033ACB-A106-488F-94E5-FC5F72E5610D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@

<PropertyGroup>
<PackageId>Zupit.VersionEndpoint</PackageId>
<Version>0.0.1-alpha</Version>
<Version>0.0.2-alpha</Version>
<Authors>Zupit Developers</Authors>
<Company>Zupit</Company>
<PackageTags>Version;Endpoint;Zupit</PackageTags>
<Description>Zupit.VersionEndpoint adds an API endpoint returing the app assembly version.</Description>
<Copyright>Copyright (c) Zupit 2024</Copyright>
<PackageProjectUrl>https://github.com/zupit-it/zupit-dotnet</PackageProjectUrl>
<RepositoryUrl>https://github.com/zupit-it/zupit-dotnet.git</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="../../icon.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions Zupit.VersionEndpoint/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "8.0.101",
"rollForward": "disable",
"allowPrerelease": false
}
}
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.

0 comments on commit 5f5f09c

Please sign in to comment.