Skip to content

Merge pull request #524 from distantcam/dependabot/github_actions/act… #862

Merge pull request #524 from distantcam/dependabot/github_actions/act…

Merge pull request #524 from distantcam/dependabot/github_actions/act… #862

Workflow file for this run

name: 🛠️ build
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-**"
jobs:
test:
name: 🧪 Run tests
uses: ./.github/workflows/test.yml
build:
name: 🛠️ Build
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
needs: test
steps:
- name: 🛒 Check-out code
uses: actions/checkout@v7
- name: 📐 Setup .NET Core SDK
uses: actions/setup-dotnet@v6
with:
global-json-file: src/global.json
- name: 📦 Cache NuGet packages
uses: actions/cache@v6
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('**/Directory.Packages.props') }}
restore-keys: nuget-
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
- name: 🔧 Load packages
run: dotnet restore
- name: 🛠️ Build code
run: >
dotnet build
--configuration Release
-p:Version=${{ github.ref_name }}
-p:GitSha=${{ github.sha }}
--no-restore
- name: 📦 Pack NuGet
run: >
dotnet pack src/AutoCtor.Attributes/AutoCtor.Attributes.csproj
--configuration Release
-p:Version=${{ github.ref_name }}
-p:GitSha=${{ github.sha }}
--no-build
- name: 📝 Generate Release Notes
run: gh release create ${{ github.ref_name }} --draft --generate-notes nugets/*.nupkg
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}