Skip to content

Commit

Permalink
CI: added package job
Browse files Browse the repository at this point in the history
Added package job to CI that should create and publish a nuget
package if NUGET_API_KEY secret is present and branch is
master.
  • Loading branch information
webwarrior-ws committed Aug 2, 2023
1 parent 47ffaf0 commit 527a9be
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,37 @@ jobs:

- name: Run tests
run: dotnet test NLitecoin.sln

package:
name: Package (Nuget)
needs: build-linux
runs-on: ubuntu-22.04
env:
BASE_VERSION: "0.1.0"
steps:
- uses: actions/checkout@v2

- name: Install .NET 6
run: |
which sudo 2>/dev/null || (apt update && apt install --yes sudo)
sudo apt update
sudo apt install --yes --no-install-recommends ca-certificates
sudo apt install --yes --no-install-recommends dotnet6
- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Package
# https://stackoverflow.com/questions/70249519/how-to-check-if-a-secret-variable-is-empty-in-if-conditional-github-actions
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
if: "${{ env.NUGET_API_KEY != '' && github.ref == 'refs/heads/master' }}"
run: |
git clone -b stable https://github.com/nblockchain/fsx
cd fsx
sudo ./scripts/CI/install_mono_from_microsoft_deb_packages.sh
cd ../src/NLitecoin
../../fsx/Tools/nugetPush.fsx $BASE_VERSION ${{secrets.NUGET_API_KEY}}

0 comments on commit 527a9be

Please sign in to comment.