-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (55 loc) · 2.61 KB
/
Copy pathPublishRelease.yml
File metadata and controls
71 lines (55 loc) · 2.61 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish/Upload dotnet package on release
# PLEASE NOTE: PUBLISHING/DEPLOYMENT
# Release is to be created manually at GitHub releases management page
# - release name usually contains "v1.2.3"
# After creating a GitHub release, following actions will automatically run:
# 1. NuGet package (version as defined in VS.Net project property "package version")
# 2. Attaching of compiled binaries to GitHub release
on:
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Name of project configuration for build as well as name of the bin output subdirectory (both must match for "dotnet pack" to find compiled files!)
BUILD_CONFIGURATION: Release
# Name of build project which creates required output for packaging/deployment
BUILD_PROJECT: CompuMaster.VisualBasicCompatibility/CompuMaster.VisualBasicCompatibility.csproj
# Name of directory (e.g. "bin") containing the subdirectory (e.g. "CI_CD") with all output files (*.dll)
BUILD_OUTPUT_BASEDIR: CompuMaster.VisualBasicCompatibility/bin
jobs:
publish:
runs-on: ubuntu-latest
#if: false # always skip job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration=${{env.BUILD_CONFIGURATION}} --no-restore
- name: Pack binaries
run: |
(cd ${{env.BUILD_OUTPUT_BASEDIR}}/${{env.BUILD_CONFIGURATION}} && zip $OLDPWD/bin.zip -r .)
- name: Publish binaries
uses: softprops/action-gh-release@v1
with:
files: "bin.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Pack
run: dotnet pack --no-build --configuration=${{env.BUILD_CONFIGURATION}} ${{env.BUILD_PROJECT}} --output .
- name: PushNuget
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
- name: Publish Package Artifacts
uses: actions/upload-artifact@v4
with:
name: Nupkg Artifacts
path: ./**/*.nupkg