Skip to content

Allow calling nodeswap use to make use of .nodeswap file. #22

Allow calling nodeswap use to make use of .nodeswap file.

Allow calling nodeswap use to make use of .nodeswap file. #22

Workflow file for this run

name: .NET Core
# Trigger on any push with a git tag
# To create a git tag, run the following commands on the branch you wish to release:
# git tag 1.0.0.0
# git push origin --tags
on:
push:
tags:
- "*"
jobs:
build:
runs-on: windows-latest
env:
Project_Directory: NodeSwap
Project_Filename: NodeSwap.csproj
Installer_Directory: NodeSwap.Installer
Installer_Filename: NodeSwap.Installer.msi
steps:
- uses: actions/checkout@v2
- name: Add dotnet to PATH
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
# The installer utilizes WiX 3.x, which is not compatible with the dotnet CLI.
# It uses the older NuGet packages.config file and is built directly with MSBuild.
# Therefore, we need both MSBuild and NuGet.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Add nuget to PATH
uses: nuget/setup-nuget@v1.0.5
with:
nuget-version: '5.x'
# Fetch deps
- name: Restore deps
run: dotnet restore
# Builds the main App & Test projects.
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --configuration Release
- name: Publish
run: dotnet publish --configuration Release $env:Project_Directory\$env:Project_Filename
# The installer must be built separately because it is not supported by the dotnet CLI.
- name: Get installer deps
run: nuget restore $env:Installer_Directory -PackagesDirectory packages
- name: Build installer
run: MSBuild $env:Installer_Directory -p:Configuration=Release
# Get the name of the tag that was pushed
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
# Create the release: https://github.com/actions/create-release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions; you do not need to create your own token
with:
tag_name: build-release.${{ github.ref }}
release_name: ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
# Upload release asset: https://github.com/actions/upload-release-asset
- name: Upload installer MSI
id: upload-release-asset-2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.Installer_Directory }}\bin\Release\en-us\${{ env.Installer_Filename }}
asset_name: ${{ env.Installer_Filename }}
asset_content_type: application/zip