Skip to content

Commit

Permalink
Merge pull request #3 from atc-net/feature/release-please
Browse files Browse the repository at this point in the history
Add release-please workflow
  • Loading branch information
perkops authored Aug 20, 2024
2 parents fba4d01 + e4b8a53 commit 7768443
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 179 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: "Pre-Integration"
name: Build and test

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:

jobs:
dotnet-build:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -31,27 +27,6 @@ jobs:
run: dotnet restore

- name: 🛠️ Building library in release mode
run: dotnet build -c Release --no-restore

dotnet-test:
runs-on: ubuntu-latest
needs:
- dotnet-build
steps:
- name: 🛒 Checkout repository0
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: 🔁 Restore packages
run: dotnet restore

- name: 🛠️ Build
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: 🧪 Run unit tests
Expand Down
82 changes: 0 additions & 82 deletions .github/workflows/post-integration.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: release-please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.RELEASE_PLEASE_PAT }}

- name: 🛒 Checkout repository
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLEASE_PAT }}

- name: ⚙️ Setup dotnet 8.0.x
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: 🧹 Clean
if: ${{ steps.release.outputs.release_created }}
run: dotnet clean -c Release && dotnet nuget locals all --clear

- name: 🔁 Restore packages
if: ${{ steps.release.outputs.release_created }}
run: dotnet restore

- name: 🛠️ Building library in release mode
if: ${{ steps.release.outputs.release_created }}
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: 🗳️ Creating library package for release
if: ${{ steps.release.outputs.release_created }}
run: dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true

- name: 📦 Push packages to NuGet
if: ${{ steps.release.outputs.release_created }}
run: |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
57 changes: 0 additions & 57 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.8"
}
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>

<PropertyGroup Label="Versioning">
<!-- The 'x-release-please-' comments are used to inform the release-please action that it should update the semver version here -->
<!-- x-release-please-start-version -->
<Version>1.0.8</Version>
<!-- x-release-please-end -->
<IncludeSourceRevisionInInformationalVersion>true</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<PropertyGroup Label="Compile settings">
<Nullable>enable</Nullable>
<LangVersion>12.0</LangVersion>
Expand Down
13 changes: 13 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"bootstrap-sha": "fba4d0158b0373d80f6fe37da2c3c9e4073ff703",
"pull-request-title-pattern": "chore: release version ${version}",
"packages": {
".": {
}
},
"extra-files": [
"Directory.Build.props"
]
}
1 change: 0 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.141" PrivateAssets="All" />
</ItemGroup>
</Project>
11 changes: 0 additions & 11 deletions version.json

This file was deleted.

0 comments on commit 7768443

Please sign in to comment.