Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lithiumtoast committed Aug 6, 2023
1 parent bd6a2e5 commit 1f117c4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: "Release"
on:
workflow_dispatch:
inputs:
pre-release:
description: 'Pre-release?'
upload-nuget-packages:
description: 'Is this a release-candidate? (Candidates get uploaded to MyGet.org instead of NuGet.org)'
required: true
default: 'true'
schedule:
Expand Down Expand Up @@ -44,8 +44,12 @@ jobs:
name: "native-libraries-linux-x64"
path: "./lib"

- name: "Set package version"
id: set-package-version
run: echo "PACKAGE_VERSION=$(date +'%Y.%m.%d')" >> "$GITHUB_OUTPUT"

- name: ".NET pack"
run: dotnet pack "./src/cs" --nologo --verbosity minimal --configuration Release -p:PackageVersion="$(date +'%Y.%m.%d')" -p:RepositoryBranch="${{ github.head_ref || github.ref_name }}" -p:RepositoryCommit="${{ github.sha }}"
run: dotnet pack "./src/cs" --nologo --verbosity minimal --configuration Release -p:PackageVersion="${{ steps.set-package-version.outputs.PACKAGE_VERSION }}" -p:RepositoryBranch="${{ github.head_ref || github.ref_name }}" -p:RepositoryCommit="${{ github.sha }}"

- name: "Upload packages to MyGet"
if: github.event_name == 'workflow_dispatch' && github.event.inputs.pre-release == 'true'
Expand All @@ -54,8 +58,7 @@ jobs:
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://www.myget.org/F/bottlenoselabs/api/v3/index.json --skip-duplicate --api-key $MYGET_ACCESS_TOKEN

- name: "Upload packages to NuGet"
if: github.event_name == 'schedule' || github.event.inputs.pre-release != 'true'
if: github.event_name == 'schedule' || github.event.inputs.pre-release != 'false'
env:
NUGET_ACCESS_TOKEN: ${{ secrets.NUGET_ACCESS_TOKEN }}
run: echo "Hello!"
# dotnet nuget push "./nupkg/**/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $NUGET_ACCESS_TOKEN
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $NUGET_ACCESS_TOKEN

0 comments on commit 1f117c4

Please sign in to comment.