Skip to content

Commit 78ebce2

Browse files
authored
Merge pull request #18 from TraGicCode/GH-17-automate-nuget-dotnet-tool-release
(GH-17) Automate dotnet-tool release
2 parents 89bdda6 + 87335fe commit 78ebce2

4 files changed

Lines changed: 54 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
jobs:
7+
get-version:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
version: ${{ steps.changelog.outputs.version }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Extract version from CHANGELOG.md
15+
id: changelog
16+
run: |
17+
version=$(grep -m 1 -oP '^##\s*\[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
18+
echo "version=$version" >> $GITHUB_OUTPUT
19+
tag:
20+
needs: get-version
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Create and push git tag
28+
run: |
29+
version=${{ needs.get-version.outputs.version }}
30+
31+
git config user.name "github-actions[bot]"
32+
git config user.email "github-actions[bot]@users.noreply.github.com"
33+
34+
git tag "v$version"
35+
git push origin "v$version"
36+
docker:
37+
needs: get-version
38+
uses: ./.github/workflows/docker_build.yml
39+
with:
40+
version: ${{ needs.get-version.outputs.version }}
41+
secrets: inherit
42+
43+
nuget:
44+
needs: get-version
45+
uses: ./.github/workflows/dotnet_tool_build.yml
46+
with:
47+
version: ${{ needs.get-version.outputs.version }}
48+
secrets: inherit

.github/workflows/release_prep.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030

3131
- name: "commit changes"
3232
run: |
33-
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
34-
git config --local user.name "GitHub Actions"
33+
git config user.name "github-actions[bot]"
34+
git config user.email "github-actions[bot]@users.noreply.github.com"
3535
git add .
3636
git commit -m "Release prep v${{ github.event.inputs.version }}"
3737

src/BuslyCLI.Console/BuslyCLI.Console.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<RootNamespace>BuslyCLI</RootNamespace>
88
<PackAsTool>true</PackAsTool>
99
<!-- Dotnet tool packageid in nuget -->
10-
<PackageId>dotnet-busly-cli</PackageId>
11-
<ToolCommandName>busly-cli</ToolCommandName>
10+
<PackageId>dotnet-busly</PackageId>
11+
<ToolCommandName>dotnet-busly</ToolCommandName>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

website/docs/getting-started/quick-start.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ docker run --rm tragiccode/busly-cli --help
3232
<TabItem value="dotnet" label=".NET tool (via NuGet)">
3333

3434
```bash
35-
dotnet tool install --global dotnet-busly-cli
35+
dotnet tool install --global dotnet-busly
36+
dotnet-busly --help
3637
```
3738

3839
</TabItem>

0 commit comments

Comments
 (0)