Skip to content

Commit

Permalink
deps: update to .net 9 and add release github action
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jorgeparavicini committed Nov 20, 2024
1 parent 65c3ed7 commit 6b00be7
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
workflow_dispatch:
push:
branches:
- main

jobs:
version:
name: Create New version
runs-on: ubuntu-latest
steps:
- name: 🔻 Checkout
uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: 🏷️ Semantic Release
id: release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/github
@semantic-release/git
@semantic-release/exec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Deploy version
runs-on: ubuntu-latest
strategy:
matrix:
project-name: [ Rapidata.MongoDB.Migrations, Rapidata.MongoDB.Migrations.AspNetCore ]
needs: [ version ]
steps:
- name: Pack & Publish to NuGet
run: |
dotnet pack src/${{ matrix.project-name }}/${{ matrix.project-path }}.csproj --configuration Release --include-symbols --output ${{ github.workspace }}/output/${{ matrix.project-name }}
dotnet nuget push ${{ github.workspace }}/output/${{ matrix.project-name }}/*.nupkg -k ${{ secrets.NUGET_TOKEN }} -s ${{ secrets.NUGET_PUSH_URL }}
34 changes: 34 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"branches": [
"v+([0-9])?(.{+([0-9]),x}).x",
"main",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"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'"
}
],
[
"@semantic-release/git",
{
"assets": [
"$CURRENT_PROJECT"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Rapidata</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Rapidata</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
4 changes: 4 additions & 0 deletions updateVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

echo "new_release_version=$1" >> "$GITHUB_OUTPUT"
sed -i '' "s#<Version>.*#<Version>$1</Version>#" "$2"

0 comments on commit 6b00be7

Please sign in to comment.