Skip to content

Replace build arguments with docker/compose secrets #81

Replace build arguments with docker/compose secrets

Replace build arguments with docker/compose secrets #81

Workflow file for this run

name: publish-nuget-package
on:
push:
branches:
- main
- feature/**
jobs:
calculate-version:
name: Calculate Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine package version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Display package version
run: |
echo "Version: $GITVERSION_NUGETVERSIONV2"
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-latest
needs: calculate-version
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dotnet format
run: dotnet tool install dotnet-format --tool-path ./dotnet-format-local/
- name: Run formatter check
run: ./dotnet-format-local/dotnet-format --check
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{secrets.GITHUB_TOKEN }}
outputs:
version: ${{ needs.calculate-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker compose build hackney-shared-activity-history-test
- name: Run tests
run: docker compose run hackney-shared-activity-history-test
publish-package:
name: Publish Package
runs-on: ubuntu-latest
needs: build-and-test
env:
LBHPACKAGESTOKEN: ${{secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.build-and-test.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build the Package
run: dotnet pack Hackney.Shared.ActivityHistory -p:PackageVersion=$VERSION --configuration Release
- name: Publish the Package
run: |
cd Hackney.Shared.ActivityHistory/bin/Release
dotnet nuget push Hackney.Shared.ActivityHistory.*.nupkg -s https://nuget.pkg.github.com/LBHackney-IT/index.json --api-key ${{ secrets.GITHUB_TOKEN }}