chore(deps): update dependency microsoft.sourcelink.github to v8 #222
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
name: release | |
# TODO | |
# - Get AssemblyName, TargetFramework (TFM), RuntimeIdentifier (RID) from Directory.Build.props, *.csproj | |
# - Overwrite `$env:RID and `$env:TFM with build props, allowing workflows to be driven by the project(s) | |
# - support multiple ASSEMBLYNAME parameters for matrices | |
on: | |
push: | |
branches: [ main, develop ] | |
paths-ignore: | |
- ".github/**/*.*" | |
- "**/*.md" | |
- "**/*.txt" | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
env: | |
RID: "win-x86" | |
TFM: "net5.0-windows" | |
ASSEMBLYNAME: "HXE" | |
PROJPATH: "./src/HXE.csproj" | |
steps: | |
################ | |
# SETUP | |
################ | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Required by GitVersion | |
submodules: "recursive" | |
- name: Setup Node | |
uses: actions/[email protected] | |
- run: npm install | |
# Dependents: Semantic Release | |
# Authenticates packages to push to GPR | |
- uses: actions/[email protected] | |
with: | |
dotnet-version: "6.0.x" # SDK Version to use. | |
include-prerelease: true | |
- name: Add GitHub Package Repository | |
run: dotnet nuget add source https://nuget.pkg.github.com/HaloSPV3/index.json -n "github" -u USERNAME -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
- name: Set NuGet.org Credentials | |
run: dotnet nuget update source "nuget.org" -u USERNAME -p ${{ secrets.NUGET_TOKEN }} --store-password-in-clear-text | |
################ | |
# BUILD | |
################ | |
- name: dotnet-publish | |
run: dotnet publish $env:CSPROJ_RELPATH -c Release --no-self-contained -p:ContinuousIntegrationBuild=true | |
# required variables: TargetFramework, RuntimeIdentifier, GitVersion_FullSemVer | |
- name: Compress-PublishArtifacts | |
run: | | |
$publishPath = Resolve-Path ".\bin\Release\$env:TFM\$env:RID\publish"; | |
$archiveName = "$env:ASSEMBLYNAME.$env:TFM-$env:RID.$env:GitVersion_FullSemVer.zip"; | |
Set-Location $publishPath; | |
Compress-Archive -Path $publishPath -DestinationPath $archiveName -CompressionLevel Optimal; | |
################ | |
# RELEASE | |
################ | |
- name: Semantic Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: publish-artifacts | |
path: bin/Release/${{ env.TFM }}/${{ env.RID }}/publish | |
- name: Publish to GitHub Packages | |
working-directory: bin/Release | |
run: dotnet nuget push *.nupkg -s "github" -k ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to nuget.org | |
working-directory: bin/Release | |
run: dotnet nuget push *.nupkg -s "nuget.org" -k ${{ secrets.NUGET_TOKEN }} |