-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish NuGet | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version number' | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
PROJECT_FILE: src/FSharp.Finance.Personal.fsproj | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
|
||
- name: Get current version | ||
id: get_version | ||
run: | | ||
CURRENT_VERSION=$(grep -oP '(?<=<Version>)[^<]+' ${{ env.PROJECT_FILE }}) | ||
echo "Current version is $CURRENT_VERSION" | ||
echo "::set-output name=current_version::$CURRENT_VERSION" | ||
- name: Update version number | ||
run: | | ||
VERSION=${{ github.event.inputs.version }} | ||
echo "Updating version to $VERSION" | ||
sed -i "s/<Version>[0-9]\+\.[0-9]\+\.[0-9]\+<\/Version>/<Version>$VERSION<\/Version>/" ${{ env.PROJECT_FILE }} | ||
- name: Build | ||
run: dotnet build -c Release | ||
|
||
- name: Pack | ||
run: dotnet pack -c Release --no-build --output . | ||
|
||
# - name: Publish NuGet package | ||
# run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json | ||
|
||
- name: Create Git tag | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email 'github-actions@github.com' | ||
git tag $VERSION | ||
git push origin $VERSION |