Skip to content

Merge pull request #277 from phantasma-io/dev #18

Merge pull request #277 from phantasma-io/dev

Merge pull request #277 from phantasma-io/dev #18

name: .NET Nuget Publish
on:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
pull-requests: write
actions: write
issues: write
contents: write
env:
GITHUB_TOKEN: ${{ secrets.PR_KEY }}
jobs:
build:
name: Build and Publish Nuget
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
with:
GITHUB_TOKEN: ${{ secrets.PR_KEY }}
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: |
sudo apt-get install libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev
sudo apt-get install libc6-dev libicu-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev librocksdb-dev
sudo apt-get install librocksdb-dev
dotnet tool install --global dotnet-reportgenerator-globaltool
dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack Nuget
run: dotnet pack --configuration Release --no-restore
- name: Publish Nuget
run: |
dotnet nuget push ./Phantasma.Business/src/bin/Release/Phantasma.Business.*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push ./Phantasma.Core/src/bin/Release/Phantasma.Core.*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push ./Phantasma.Tendermint/bin/Release/Phantasma.Tendermint.*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push ./Phantasma.Tendermint.RPC/bin/Release/Phantasma.Tendermint.RPC.*.nupkg --skip-duplicate -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
#- name: Publish Nuget Github
# run: |
# dotnet nuget add source --skip-duplicate --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/phantasma-io/index.json"
# dotnet nuget push "./Phantasma.Business/src/bin/Release/Phantasma.Business.*.nupkg" --skip-duplicate --api-key ${{secrets.PR_KEY}} --source "github"
# dotnet nuget push "./Phantasma.Core/src/bin/Release/Phantasma.Core.*.nupkg" --skip-duplicate --api-key ${{secrets.PR_KEY}} --source "github"
# dotnet nuget push "./Phantasma.Tendermint/bin/Release/Phantasma.Tendermint.*.nupkg" --skip-duplicate --api-key ${{secrets.PR_KEY}} --source "github"
# dotnet nuget push "./Phantasma.Tendermint.RPC/bin/Release/Phantasma.Tendermint.RPC.*.nupkg" --skip-duplicate --api-key ${{secrets.PR_KEY}} --source "github"