Skip to content

Commit d90f2bd

Browse files
committed
ci: 👷 Add CI for GoDough
1 parent 7fc71ae commit d90f2bd

File tree

5 files changed

+98
-3
lines changed

5 files changed

+98
-3
lines changed

.github/prepare-library.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
VERSION=$1
2+
3+
xmlstarlet edit \
4+
--inplace \
5+
--update "/Project/PropertyGroup/AssemblyVersion" \
6+
--value "$VERSION" \
7+
GoDough.csproj

.github/release-package.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VERSION=$1
2+
3+
dotnet pack --configuration Release
4+
echo dotnet nuget push GoDough.${VERSION}.nupkg

.github/workflows/on_push.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build & Release
2+
on: push
3+
permissions:
4+
contents: read
5+
packages: read
6+
7+
jobs:
8+
on_push:
9+
permissions:
10+
contents: write
11+
packages: write
12+
name: On Push
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 20.8.1
20+
- name: Setup xmlstarlet
21+
run: sudo apt update && apt install -y xmlstarlet
22+
- name: Setup .NET Core
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: 6.0.421
26+
- name: Cache npm
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
32+
- name: Build
33+
run: dotnet build --configuration Release
34+
- name: Test
35+
run: dotnet test --configuration Release --no-build
36+
- name: Publish package
37+
run: |
38+
npx \
39+
--package @semantic-release/commit-analyzer \
40+
--package @semantic-release/release-notes-generator \
41+
--package @semantic-release/github \
42+
--package @semantic-release/exec \
43+
--package @semantic-release/git \
44+
semantic-release
45+
if: github.ref_name == 'main'
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
branches: ['main'],
3+
plugins: [
4+
[
5+
'@semantic-release/commit-analyzer',
6+
{
7+
preset: 'angular',
8+
releaseRules: [
9+
{ type: 'docs', scope: 'README', release: 'patch' },
10+
{ type: 'refactor', release: 'patch' },
11+
{ type: 'style', release: 'patch' },
12+
],
13+
parserOpts: {
14+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
15+
},
16+
},
17+
],
18+
'@semantic-release/release-notes-generator',
19+
'@semantic-release/github',
20+
[
21+
'@semantic-release/exec',
22+
{
23+
prepareCmd: './.github/prepare-library.sh ${nextRelease.version}',
24+
publishCmd: './.github/release-package.sh ${nextRelease.version}',
25+
},
26+
],
27+
[
28+
'@semantic-release/git',
29+
{
30+
assets: ['GoDough.csproj'],
31+
message:
32+
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
33+
},
34+
],
35+
],
36+
};

GoDough.csproj

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
<?xml version="1.0"?>
12
<Project Sdk="Godot.NET.Sdk/4.0.2">
23
<PropertyGroup>
34
<TargetFramework>net6.0</TargetFramework>
45
<EnableDynamicLoading>true</EnableDynamicLoading>
6+
<AssemblyVersion>3.4.5</AssemblyVersion>
57
</PropertyGroup>
6-
78
<ItemGroup>
8-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
9-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
9+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0"/>
10+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0"/>
1011
</ItemGroup>
1112
</Project>

0 commit comments

Comments
 (0)