v8.0.8 #103
Workflow file for this run
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: Publish | |
on: | |
workflow_dispatch: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: ['8.0.x'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion # https://github.com/GitTools/actions/blob/main/docs/examples/github/gitversion/setup/usage-examples.md | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: '5.x' | |
- name: Compute Version | |
id: gitversion # id to later be referenced | |
uses: gittools/actions/gitversion/execute@v0 | |
with: | |
useConfigFile: true | |
additionalArguments: '/updateprojectfiles' | |
- name: Display GitVersion outputs (step output) | |
run: | | |
echo "Branch: ${{ github.ref }}" | |
echo "Major: ${{ steps.gitversion.outputs.major }}" | |
echo "Minor: ${{ steps.gitversion.outputs.minor }}" | |
echo "Patch: ${{ steps.gitversion.outputs.patch }}" | |
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}" | |
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}" | |
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}" | |
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}" | |
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}" | |
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}" | |
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}" | |
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}" | |
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}" | |
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}" | |
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}" | |
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}" | |
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}" | |
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}" | |
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}" | |
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}" | |
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}" | |
echo "EscapedBranchName: ${{ steps.gitversion.outputs.escapedBranchName }}" | |
echo "Sha: ${{ steps.gitversion.outputs.sha }}" | |
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}" | |
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | |
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}" | |
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}" | |
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}" | |
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}" | |
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}" | |
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}" | |
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}" | |
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}" | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Build | |
run: dotnet build ./src/Nox.Cli --warnaserror --configuration Release | |
- name: Pack | |
run: dotnet pack --no-build ./src/Nox.Cli --configuration Release -o ./artifacts | |
- name: Publish | |
run: dotnet nuget push ./artifacts/Nox.Cli.*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Publish Server | |
id: publish_server | |
run: dotnet publish ./src/Nox.Cli.Server --configuration Release --output ./artifacts/server | |
# Zip the published files | |
- run: zip -r "server.zip" "./artifacts/server" | |
- name: Fetch Latest Release | |
id: get_latest_release | |
uses: gregziegan/fetch-latest-release@v2.0.0 | |
- name: Upload Server Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_latest_release.outputs.upload_url }} | |
asset_path: server.zip | |
asset_name: server.zip | |
asset_content_type: application/zip |