Skip to content

Commit 6b00be7

Browse files
deps: update to .net 9 and add release github action
deps: bump github actions versions fix: github actions fix: try again fix again fix: make script executable fix: github actions fix: github actions fix: add runs on to github action fix: push requirement
1 parent 65c3ed7 commit 6b00be7

File tree

7 files changed

+87
-4
lines changed

7 files changed

+87
-4
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version:
10+
name: Create New version
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 🔻 Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup dotnet
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 9.0.x
20+
21+
- name: 🏷️ Semantic Release
22+
id: release
23+
uses: cycjimmy/semantic-release-action@v4
24+
with:
25+
extra_plugins: |
26+
@semantic-release/commit-analyzer
27+
@semantic-release/release-notes-generator
28+
@semantic-release/github
29+
@semantic-release/git
30+
@semantic-release/exec
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
deploy:
35+
name: Deploy version
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
project-name: [ Rapidata.MongoDB.Migrations, Rapidata.MongoDB.Migrations.AspNetCore ]
40+
needs: [ version ]
41+
steps:
42+
- name: Pack & Publish to NuGet
43+
run: |
44+
dotnet pack src/${{ matrix.project-name }}/${{ matrix.project-path }}.csproj --configuration Release --include-symbols --output ${{ github.workspace }}/output/${{ matrix.project-name }}
45+
dotnet nuget push ${{ github.workspace }}/output/${{ matrix.project-name }}/*.nupkg -k ${{ secrets.NUGET_TOKEN }} -s ${{ secrets.NUGET_PUSH_URL }}

.releaserc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"branches": [
3+
"v+([0-9])?(.{+([0-9]),x}).x",
4+
"main",
5+
{
6+
"name": "beta",
7+
"prerelease": true
8+
},
9+
{
10+
"name": "alpha",
11+
"prerelease": true
12+
}
13+
],
14+
"plugins": [
15+
"@semantic-release/commit-analyzer",
16+
"@semantic-release/release-notes-generator",
17+
"@semantic-release/github",
18+
[
19+
"@semantic-release/exec",
20+
{
21+
"prepareCmd": "./updateVersion.sh '${nextRelease.version}' 'src/Rapidata.MongoDB.Migrations/Rapidata.MongoDB.Migrations.csproj' && ./updateVersion.sh '${nextRelease.version}' 'src/Rapidata.MongoDB.Migrations.AspNetCore/Rapidata.MongoDB.Migrations.AspNetCore.csproj'"
22+
}
23+
],
24+
[
25+
"@semantic-release/git",
26+
{
27+
"assets": [
28+
"$CURRENT_PROJECT"
29+
],
30+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
31+
}
32+
]
33+
]
34+
}

src/Rapidata.MongoDB.Migrations.AspNetCore/Rapidata.MongoDB.Migrations.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<Authors>Rapidata</Authors>

src/Rapidata.MongoDB.Migrations/Rapidata.MongoDB.Migrations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<Authors>Rapidata</Authors>

tests/Rapidata.MongoDB.Migrations.Tests.Integration/Rapidata.MongoDB.Migrations.Tests.Integration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

tests/Rapidata.MongoDB.Migrations.Tests.Unit/Rapidata.MongoDB.Migrations.Tests.Unit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

updateVersion.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
echo "new_release_version=$1" >> "$GITHUB_OUTPUT"
4+
sed -i '' "s#<Version>.*#<Version>$1</Version>#" "$2"

0 commit comments

Comments
 (0)