Skip to content

Commit 6060850

Browse files
authored
separate workflows and change version to 0.0.1
1 parent 37bb060 commit 6060850

File tree

4 files changed

+119
-75
lines changed

4 files changed

+119
-75
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: windows-latest
14+
15+
env:
16+
Dotnet_Version: 8.0.x
17+
Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
18+
19+
steps:
20+
21+
# Checkout codes
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
# Install the .NET Core workload
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: ${{ env.Dotnet_Version }}
30+
31+
# Restore dependencies
32+
- name: Restore dependencies
33+
run: dotnet restore ${{ env.Project_Path }}
34+
35+
# Build the project
36+
- name: Build
37+
run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore
38+
39+
# Execute all unit tests in the solution
40+
- name: Execute unit tests
41+
if: github.event_name == 'push' && github.ref != 'refs/heads/main'
42+
run: dotnet test --configuration Release --no-build
43+
44+
# Pack the NuGet package
45+
- name: Create NuGet package
46+
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs
47+
48+
# Upload the NuGet package
49+
- name: Upload NuGet package
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: Full nupkg
53+
path: nupkgs/Flow.Launcher.Localization.*.nupkg
54+
compression-level: 0
Lines changed: 63 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,63 @@
1-
name: .NET Core Desktop
2-
3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches: [ "main" ]
7-
pull_request:
8-
9-
jobs:
10-
11-
build:
12-
13-
runs-on: windows-latest
14-
15-
env:
16-
Dotnet_Version: 8.0.x
17-
Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
18-
19-
steps:
20-
21-
# Checkout codes
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
25-
# Install the .NET Core workload
26-
- name: Setup .NET
27-
uses: actions/setup-dotnet@v4
28-
with:
29-
dotnet-version: ${{ env.Dotnet_Version }}
30-
31-
# Restore dependencies
32-
- name: Restore dependencies
33-
run: dotnet restore ${{ env.Project_Path }}
34-
35-
# Build the project
36-
- name: Build
37-
run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore
38-
39-
# Execute all unit tests in the solution
40-
- name: Execute unit tests
41-
run: dotnet test --configuration Release --no-build
42-
43-
# Pack the NuGet package
44-
- name: Create NuGet package
45-
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs
46-
47-
# Upload the NuGet package
48-
- name: Upload NuGet package
49-
uses: actions/upload-artifact@v4
50-
with:
51-
name: Full nupkg
52-
path: nupkgs/Flow.Launcher.Localization.*.nupkg
53-
compression-level: 0
54-
55-
# Publish to NuGet.org
56-
- name: Push to NuGet
57-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
58-
run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }}
59-
60-
# Get package version
61-
- name: Get Package Version
62-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63-
run: |
64-
$version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion
65-
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
66-
67-
# Publish to GitHub releases
68-
- name: Publish GitHub releases
69-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
70-
uses: softprops/action-gh-release@v1
71-
with:
72-
files: "nupkgs\\*.nupkg"
73-
tag_name: "v${{ env.release_version }}"
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
13+
build:
14+
15+
runs-on: windows-latest
16+
17+
env:
18+
Dotnet_Version: 8.0.x
19+
Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj
20+
21+
steps:
22+
23+
# Checkout codes
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
# Install the .NET Core workload
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: ${{ env.Dotnet_Version }}
32+
33+
# Restore dependencies
34+
- name: Restore dependencies
35+
run: dotnet restore ${{ env.Project_Path }}
36+
37+
# Build the project
38+
- name: Build
39+
run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore
40+
41+
# Pack the NuGet package
42+
- name: Create NuGet package
43+
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs
44+
45+
# # Publish to NuGet.org
46+
# - name: Push to NuGet
47+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
48+
# run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }}
49+
50+
# Get package version
51+
- name: Get Package Version
52+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
53+
run: |
54+
$version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion
55+
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append
56+
57+
# Publish to GitHub releases
58+
- name: Publish GitHub releases
59+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
60+
uses: softprops/action-gh-release@v1
61+
with:
62+
files: "nupkgs\\*.nupkg"
63+
tag_name: "v${{ env.release_version }}"

Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localization.Analyzers.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-
<Version>1.0.0</Version>
4+
<Version>0.0.1</Version>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
77
<RootNamespace>Flow.Launcher.Localization.Analyzers</RootNamespace>

Flow.Launcher.Localization.SourceGenerators/Flow.Launcher.Localization.SourceGenerators.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-
<Version>1.0.0</Version>
4+
<Version>0.0.1</Version>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
77
<RootNamespace>Flow.Launcher.Localization.SourceGenerators</RootNamespace>

0 commit comments

Comments
 (0)