CD - v1.8.0-alpha.0 #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
run-name: CD - ${{ github.event.release.tag_name }} | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
defaults: | |
run: | |
working-directory: src | |
jobs: | |
build: | |
name: 🛠️ Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: .config/global.json | |
- name: Build | |
run: dotnet build --configuration Release | |
test: | |
name: 🧪 Test | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: .config/global.json | |
- name: test | |
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=coverage/lcov.info --configuration Release | |
- name: Coveralls UnitTests | |
uses: coverallsapp/[email protected] | |
with: | |
path-to-lcov: test/dotnet-test-rerun.UnitTests/coverage/lcov.info | |
flag-name: UnitTests | |
- name: Coveralls IntegrationTests | |
uses: coverallsapp/[email protected] | |
with: | |
path-to-lcov: test/dotnet-test-rerun.IntegrationTests/coverage/lcov.info | |
flag-name: IntegrationTests | |
nuget: | |
name: 📦 Pack and Push nuget | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: .config/global.json | |
- name: Get version | |
uses: kzrnm/get-net-sdk-project-versions-action@v1 | |
id: get-version | |
with: | |
proj-path: src/dotnet-test-rerun.csproj | |
- name: pack | |
run: dotnet pack --configuration Release | |
- name: push | |
run: dotnet nuget push nupkg/dotnet-test-rerun.${{steps.get-version.outputs.version}}.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY --skip-duplicate | |
env: | |
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} | |
docker: | |
runs-on: ubuntu-latest | |
name: 🐋 Build and Push Docker Image | |
needs: test | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
uses: kzrnm/get-net-sdk-project-versions-action@v1 | |
id: get-version | |
with: | |
proj-path: src/dotnet-test-rerun.csproj | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: src | |
tags: joaoopereira/dotnet-test-rerun:latest, joaoopereira/dotnet-test-rerun:${{steps.get-version.outputs.version}} |