-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fazelukario/UsernameGener…
- Loading branch information
Showing
2 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,65 @@ | ||
# This workflow will build a .NET project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | ||
|
||
name: .NET | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_NOLOGO: true | ||
DOTNET_SDK_VERSION: 8.0 | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
configuration: [Release, Debug] | ||
|
||
name: Build and Package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | ||
|
||
- name: Verify .NET | ||
run: dotnet --info | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build project | ||
run: dotnet build --no-restore -c "${{ matrix.configuration }}" -o "build/${{ matrix.configuration }}" | ||
|
||
# - name: Test changes | ||
# run: dotnet test --no-build --verbosity normal | ||
|
||
- name: Build and Package Project | ||
run: dotnet pack --include-source -c "${{ matrix.configuration }}" -o "build/nuget/${{ matrix.configuration }}" -p:Commit="${{ github.sha }}" | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# Artifact name | ||
name: ${{ github.event.repository.name }}-build-${{ matrix.configuration }}-${{ github.sha }} | ||
|
||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ./build/${{ matrix.configuration }} | ||
retention-days: 90 | ||
|
||
- name: Upload a Nuget Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# Artifact name | ||
name: ${{ github.event.repository.name }}-nuget-${{ matrix.configuration }}-${{ github.sha }} | ||
|
||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ./build/nuget/${{ matrix.configuration }} | ||
retention-days: 90 |
This file contains 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,86 @@ | ||
# This workflow will build a .NET project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | ||
|
||
name: Release | ||
|
||
on: | ||
release: | ||
types: ["published"] | ||
|
||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_NOLOGO: true | ||
DOTNET_SDK_VERSION: 8.0 | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
configuration: [Release] | ||
|
||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | ||
|
||
- name: Verify .NET | ||
run: dotnet --info | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build project | ||
run: dotnet build -c "${{ matrix.configuration }}" | ||
|
||
# - name: Test project | ||
# run: dotnet test --no-build --verbosity normal | ||
|
||
package: | ||
strategy: | ||
matrix: | ||
configuration: [Release] | ||
|
||
name: Package and Publish | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | ||
|
||
- name: Verify .NET | ||
run: dotnet --info | ||
|
||
- name: Build and Package Project | ||
run: dotnet pack -c "${{ matrix.configuration }}" -o "build/${{ matrix.configuration }}" | ||
|
||
- name: Publish Nuget package to nuget.org | ||
run: dotnet nuget push "build/${{ matrix.configuration }}/*" --skip-duplicate -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json | ||
|
||
- name: Publish Nuget package to Github Packages | ||
run: dotnet nuget push "build/${{ matrix.configuration }}/*" --skip-duplicate -k ${{ secrets.PAT_GITHUB }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# Artifact name | ||
name: ${{ github.event.repository.name }}-release-${{ matrix.configuration }}-${{ github.sha }} | ||
|
||
# A file, directory or wildcard pattern that describes what to upload | ||
path: ./build/${{ matrix.configuration }} | ||
retention-days: 90 |