-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Action #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6493096
Add GitHub Action
Jack251970 f54111b
Update GitHub Action
Jack251970 7a3dd61
Update GitHub Action
Jack251970 40bc9c8
Fix NuGet publish issue & Add GitHub releases action
Jack251970 f64036b
Update .github/workflows/dotnet.yml
Jack251970 37bb060
Revert "Update .github/workflows/dotnet.yml"
Jack251970 6060850
separate workflows and change version to 0.0.1
jjw24 6bc2f4b
Merge branch 'main' into github_action
jjw24 71b34d6
Update Flow.Launcher.Localization.Analyzers/Flow.Launcher.Localizatio…
Jack251970 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: .NET Core Desktop | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: windows-latest | ||
|
||
env: | ||
Dotnet_Version: 8.0.x | ||
Project_Path: Flow.Launcher.Localization\Flow.Launcher.Localization.csproj | ||
|
||
steps: | ||
|
||
# Checkout codes | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Install the .NET Core workload | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.Dotnet_Version }} | ||
|
||
# Restore dependencies | ||
- name: Restore dependencies | ||
run: dotnet restore ${{ env.Project_Path }} | ||
|
||
# Build the project | ||
- name: Build | ||
run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore | ||
|
||
# Execute all unit tests in the solution | ||
- name: Execute unit tests | ||
run: dotnet test --configuration Release --no-build | ||
|
||
# Pack the NuGet package | ||
- name: Create NuGet package | ||
run: dotnet pack ${{ env.Project_Path }} --configuration Release --no-build --output nupkgs | ||
|
||
# Upload the NuGet package | ||
- name: Upload NuGet package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Full nupkg | ||
path: nupkgs/Flow.Launcher.Localization.*.nupkg | ||
compression-level: 0 | ||
|
||
# Publish to NuGet.org | ||
- name: Push to NuGet | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
run: nuget push nupkgs\*.nupkg -source 'https://api.nuget.org/v3/index.json' -apikey ${{ secrets.NUGET_API_KEY }} | ||
|
||
# Get package version | ||
- name: Get Package Version | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
run: | | ||
$version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\netstandard2.0\Flow.Launcher.Localization.dll").productversion | ||
echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append | ||
|
||
# Publish to GitHub releases | ||
- name: Publish GitHub releases | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "nupkgs\\*.nupkg" | ||
tag_name: "v${{ env.release_version }}" | ||
Jack251970 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.