Skip to content

Commit 07b025a

Browse files
committed
Add github action release workflow
1 parent c09e595 commit 07b025a

File tree

10 files changed

+70
-6
lines changed

10 files changed

+70
-6
lines changed

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
repository_dispatch:
5+
types: release
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Setup .NET Core 3.1
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 3.1.101
19+
20+
- name: Package release
21+
id: package_release
22+
run: |
23+
VERSION=`cat semver.txt`
24+
echo "##[set-output name=version;]$VERSION"
25+
dotnet test
26+
dotnet build --configuration Release
27+
dotnet pack --configuration Release --version-suffix $VERSION --output ./
28+
29+
- name: Publish package
30+
env:
31+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
32+
run: |
33+
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" *.${{ steps.package_release.outputs.version }}.nupkg
34+
35+
- name: Create github release
36+
id: create_release
37+
uses: actions/create-release@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
release_name: ${{ steps.package_release.outputs.version }}
42+
tag_name: v${{ steps.package_release.outputs.version }}
43+
draft: false
44+
prerelease: false
45+
46+
- name: Upload package to github release
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: CoderPatros.AuthenticatedHttpClient.${{ matrix.authentication }}.${{ steps.package_release.outputs.version }}.nupkg
53+
asset_name: CoderPatros.AuthenticatedHttpClient.${{ matrix.authentication }}.${{ steps.package_release.outputs.version }}.nupkg
54+
asset_content_type: application/zip

CoderPatros.AuthenticatedHttpClient.AuthorizationHeader/CoderPatros.AuthenticatedHttpClient.AuthorizationHeader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
</Project>

CoderPatros.AuthenticatedHttpClient.AzureAd/CoderPatros.AuthenticatedHttpClient.AzureAd.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
<ItemGroup>

CoderPatros.AuthenticatedHttpClient.AzureAppServiceManagedIdentity/CoderPatros.AuthenticatedHttpClient.AzureAppServiceManagedIdentity.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
<ItemGroup>

CoderPatros.AuthenticatedHttpClient.Basic/CoderPatros.AuthenticatedHttpClient.Basic.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
</Project>

CoderPatros.AuthenticatedHttpClient.CustomHeader/CoderPatros.AuthenticatedHttpClient.CustomHeader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
</Project>

CoderPatros.AuthenticatedHttpClient.QueryStringParameter/CoderPatros.AuthenticatedHttpClient.QueryStringParameter.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/coderpatros/dotnet-authenticated-httpclient.git</RepositoryUrl>
13+
<PackageVersion>$(VersionSuffix)</PackageVersion>
1314
</PropertyGroup>
1415

1516
</Project>

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
[![Build Status](https://dev.azure.com/coderpatros/OpenSource/_apis/build/status/CoderPatros.AuthenticatedHttpClient?branchName=master)](https://dev.azure.com/coderpatros/OpenSource/_build/latest?definitionId=15&branchName=master)
2-
![Azure DevOps tests](https://img.shields.io/azure-devops/tests/coderpatros/OpenSource/15.svg)
3-
![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/coderpatros/OpenSource/15.svg)
4-
[![CodeFactor](https://www.codefactor.io/repository/github/coderpatros/dotnet-authenticated-httpclient/badge)](https://www.codefactor.io/repository/github/coderpatros/dotnet-authenticated-httpclient)
5-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/152d264f1e2f490c898b7dde0a5c7956)](https://www.codacy.com/manual/coderpatros/dotnet-authenticated-httpclient?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=coderpatros/dotnet-authenticated-httpclient&amp;utm_campaign=Badge_Grade)
1+
[![Build Status](https://github.com/coderpatros/dotnet-authenticated-httpclient/workflows/.NET%20Core%20CI/badge.svg)](https://github.com/coderpatros/dotnet-authenticated-httpclient/actions?workflow=.NET+Core+CI)
62
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7-
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcoderpatros%2Fdotnet-authenticated-httpclient.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcoderpatros%2Fdotnet-authenticated-httpclient?ref=badge_shield)
83
![Twitter Follow](https://img.shields.io/twitter/follow/coderpatros?style=social)
94

105
Authenticated HttpClient

semver.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.4.3

trigger-release-workflow.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
# requires the environment variable GITHUB_TOKEN to be set
3+
# (the personal access token requires repo scope)
4+
curl -H "Accept: application/vnd.github.everest-preview+json" \
5+
-H "Authorization: token $GITHUB_TOKEN" \
6+
--request POST \
7+
--data '{"event_type": "release"}' \
8+
https://api.github.com/repos/coderpatros/dotnet-authenticated-httpclient/dispatches

0 commit comments

Comments
 (0)