Skip to content

Commit

Permalink
Publish Alpha Nugets from Develop Branch. (#70)
Browse files Browse the repository at this point in the history
* Update Nuget YAML

* Update

* Cleanup Comments
  • Loading branch information
drasticactions committed Nov 4, 2024
1 parent 0f43355 commit bb5d8e6
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
# This is a basic workflow to help you get started with Actions

name: Nuget

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main", release-*, develop ]
pull_request:
branches: [ "main", release-*, develop ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of commits
fetch-depth: 0
submodules: 'true'

# Install .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

# Pack Nuget
- name: Build and Pack Nugets
run: dotnet pack src/FishyFlip.sln --configuration Release --output nupkg

Expand All @@ -43,3 +31,34 @@ jobs:
with:
name: nupkg
path: nupkg/*.nupkg
publish:
needs: [build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'

steps:
- name: Download Nuget Package
uses: actions/download-artifact@v4
with:
name: nupkg
path: nupkg

- name: Wait for Tests
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Tests'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Publish to NuGet
run: |
for f in ./nupkg/*.nupkg
do
dotnet nuget push $f --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
done

0 comments on commit bb5d8e6

Please sign in to comment.