Skip to content

Commit

Permalink
Generate package version from Git tag for release (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfohl authored Mar 5, 2021
1 parent 37fddee commit 8c9cbc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
Expand All @@ -24,7 +22,7 @@ jobs:
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack
run: dotnet pack --configuration Release --version-suffix ci-${{ github.run_number }}
run: dotnet pack --configuration Release -p:PackageVersion=${{ github.run_number }}-ci
- name: Add Nuget source
run: dotnet nuget add source https://nuget.pkg.github.com/bridgefield/index.json -n github -u bridgefield -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
- name: Push
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Release

on: [workflow_dispatch]
on:
push:
tags:
- '*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Pack
run: dotnet pack --configuration Release
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
dotnet pack -c Release -p:PackageVersion=$VERSION
- name: Push
run: dotnet nuget push **\*.nupkg -s nuget.org -k ${{ secrets.NUGET_ORG_API_KEY }}
1 change: 0 additions & 1 deletion MonadicBits/MonadicBits.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PackageId>bridgefield.MonadicBits</PackageId>
<VersionPrefix>0.1.0-alpha</VersionPrefix>
<Authors>Andreas Pfohl</Authors>
<Company>bridgefield GmbH</Company>
<RepositoryUrl>https://github.com/bridgefield/bits</RepositoryUrl>
Expand Down

0 comments on commit 8c9cbc0

Please sign in to comment.