-
Notifications
You must be signed in to change notification settings - Fork 14
39 lines (32 loc) · 1.3 KB
/
build-package.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build and Package CLI Tool
on:
push:
branches:
- main
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x' # Set the desired .NET version
- name: Set up environment variables
run: |
echo "BUILD_ARTIFACTSTAGINGDIRECTORY=$PWD/artifacts" >> $GITHUB_ENV
echo "AI_VERSION=1.0.${{ github.run_number }}" >> $GITHUB_ENV
echo "AI_VERSION_SUFFIX=alpha" >> $GITHUB_ENV
- name: Build and package CLI tool
id: build-package
run: |
dotnet build -c Release /p:VersionAssembly=${{ env.AI_VERSION }} /p:Version=${{ env.AI_VERSION }} /p:AssemblyVersion=${{ env.AI_VERSION }} /p:VersionSuffix=${{ env.AI_VERSION_SUFFIX }} --version-suffix ${{ env.AI_VERSION_SUFFIX }}
dotnet pack -c Release --output ${{env.BUILD_ARTIFACTSTAGINGDIRECTORY}} /p:Version=${{ env.AI_VERSION }} /p:PackageVersion=${{ env.AI_VERSION }} --version-suffix ${{ env.AI_VERSION_SUFFIX }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: cli-tool-artifacts
path: ${{env.BUILD_ARTIFACTSTAGINGDIRECTORY}}