Skip to content

Commit

Permalink
Set version up-front and use bash for release version
Browse files Browse the repository at this point in the history
The string processing we do only works on bash.
  • Loading branch information
kzu committed Sep 29, 2020
1 parent 92effb1 commit 5e85677
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: set version
run: echo "::set-env name=VERSION_SUFFIX::$(git name-rev --name-only --refs=refs/heads/* HEAD).$($env:GITHUB_RUN_NUMBER)"
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100-rc.1.20452.10
Expand All @@ -20,8 +22,6 @@ jobs:
with:
dotnet-version: 3.1.x
- run: dotnet tool update -g dotnet-vs
- name: set version
run: echo "::set-env name=VERSION_SUFFIX::$(git name-rev --name-only --refs=refs/heads/* HEAD).$($env:GITHUB_RUN_NUMBER)"
- run: echo "::set-env name=MSB::$(vs where preview --prop=InstallationPath)"
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
if: env.MSB == ''
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: set version
run: echo "::set-env name=VERSION::${GITHUB_REF#refs/*/v}"
shell: bash
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100-rc.1.20452.10
Expand All @@ -22,8 +25,6 @@ jobs:
with:
dotnet-version: 3.1.x
- run: dotnet tool update -g dotnet-vs
- name: set version
run: echo "::set-env name=VERSION::${GITHUB_REF#refs/*/v}"
- run: echo "::set-env name=MSB::$(vs where preview --prop=InstallationPath)"
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
if: env.MSB == ''
Expand All @@ -35,4 +36,4 @@ jobs:
- name: pack
run: msbuild -t:pack -p:nobuild=true -p:version=$($env:VERSION)
- name: push
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
run: dotnet nuget push bin\**\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
10 changes: 10 additions & 0 deletions NuGetizer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGetizer.Tests", "src\NuGe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-nugetize", "src\dotnet-nugetize\dotnet-nugetize.csproj", "{53B47B9E-212F-420D-9E9A-68EC3B44D39E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{AFDBEE29-AF6A-4BC2-8960-DAFD2B2C2D2A}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -46,6 +53,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AFDBEE29-AF6A-4BC2-8960-DAFD2B2C2D2A} = {CDF1828A-0877-4238-A218-5E4FE219F6CC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2260BB27-4F44-4309-9D78-E459B90C1A3B}
EndGlobalSection
Expand Down

0 comments on commit 5e85677

Please sign in to comment.