From 627163c4b9be33fc83659a480afd3d0300733743 Mon Sep 17 00:00:00 2001 From: Kevin Jensen Date: Sun, 21 Feb 2021 20:50:07 -0600 Subject: [PATCH] wip workflow --- .github/workflows/pre-release2.yml | 51 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 8 +++-- Plex.Api.sln | 1 + 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pre-release2.yml diff --git a/.github/workflows/pre-release2.yml b/.github/workflows/pre-release2.yml new file mode 100644 index 0000000..e385fe5 --- /dev/null +++ b/.github/workflows/pre-release2.yml @@ -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>\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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39e1a5d..b6720ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,10 @@ 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 @@ -22,6 +26,6 @@ jobs: - 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 }} diff --git a/Plex.Api.sln b/Plex.Api.sln index c1adcb8..d6b7f0f 100644 --- a/Plex.Api.sln +++ b/Plex.Api.sln @@ -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