Skip to content

Commit

Permalink
wip workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jensenkd committed Feb 22, 2021
1 parent d66e50f commit 627163c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pre-release2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Nuget Pre-Release"
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-preview[0-9][0-9][0-9]"
jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# - name: Setup dotnet
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.200

# Publish
- name: publish on version change
id: publish_nuget
uses: rohith/publish-nuget@v2
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: Core/Core.csproj

# NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: Core

# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
# VERSION_FILE_PATH: Directory.Build.props

# Regex pattern to extract version info in a capturing group
# VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$

# Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
# VERSION_STATIC: 1.0.0

# Flag to toggle git tagging, enabled by default
# TAG_COMMIT: true

# Format of the git tag, [*] gets replaced with actual version
# TAG_FORMAT: v*

# API key to authenticate with NuGet server
# NUGET_KEY: ${{secrets.NUGET_KEY}}

# NuGet server uri hosting the packages, defaults to https://api.nuget.org
# NUGET_SOURCE: https://api.nuget.org

# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
# INCLUDE_SYMBOLS: false
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ jobs:
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Test Variation 1
run: echo "VERSION=${GITHUB_REF:10}"
- name: Test Variation 2
run: echo "VERSION=${GITHUB_REF}"
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
#- name: Push
# run: dotnet nuget push NuGet.Workflow.${VERSION}.nupkg --source https://nuget.pkg.github.com/Plex.Api/index.json --api-key ${GITHUB_TOKEN}
# run: dotnet nuget push NuGet.Workflow.${VERSION}.nupkg --source https://nuget.pkg.github.com/Plex.Api/index.json --api-key ${NUGET_KEY}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.NUGET_KEY }}
1 change: 1 addition & 0 deletions Plex.Api.sln
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\build.yml = .github\workflows\dotnet.yml
.github\workflows\release.yml = .github\workflows\release.yml
.github\workflows\pre-release.yml = .github\workflows\pre-release.yml
.github\workflows\pre-release2.yml = .github\workflows\pre-release2.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
EndProjectSection
EndProject
Expand Down

0 comments on commit 627163c

Please sign in to comment.