include files #32
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
DOTNET_NOLOGO: 1 | |
VERSION: 0.0.1 | |
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }} | |
SOLUTION: MixedIL.Fody.sln | |
jobs: | |
build: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Restore | |
run: dotnet restore ${{ env.SOLUTION }} -v q | |
- name: Test Debug | |
run: dotnet test ${{ env.SOLUTION }} --no-restore -c Debug | |
- name: Test Release | |
run: dotnet test ${{ env.SOLUTION }} --no-restore -c Release | |
- name: NuGet Publish | |
if: ${{ github.ref == 'refs/heads/master' }} | |
shell: pwsh | |
run: | | |
./build/pack.ps1 | |
- name: Set variables | |
shell: pwsh | |
run: | | |
$ver = Get-Content -Path ./build/pkg.version | |
echo "VERSION=$ver" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
echo $ver | |
- name: Create Tag | |
if: github.ref == 'refs/heads/master' | |
uses: joutvhu/create-tag@v1 | |
with: | |
tag_name: ${{ env.VERSION }} | |
on_tag_exists: skip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
if: github.ref == 'refs/heads/master' | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.VERSION }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
skipIfReleaseExists: true |