-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.69 KB
/
Copy pathbuild-and-release.yml
File metadata and controls
54 lines (45 loc) · 1.69 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
name: Build and Release
on:
workflow_dispatch:
push:
branches: master
paths: source.json
jobs:
build-and-release:
runs-on: windows-latest # Use a Windows runner for building C# WinForms apps
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.8 # Replace with the desired .NET version
- name: Install .NET SDK
run: dotnet tool install --global dotnet-ef --version 7.0.x # Replace with the desired .NET version
- name: Build
run: |
cd CasioController # Replace with the actual folder name
dotnet build --configuration Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Zip Artifacts
run: |
cd CasioController/bin/Release/net7.0-windows # Replace with the actual folder path
7z a WatchController.zip ./*.exe ./*.dll ./*.json ./*.pdb # Include all JSON and PDB files
- name: Upload Release Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: CasioController/bin/Release/WatchController.zip # Replace with the path to your zip file
asset_name: WatchController.zip
asset_content_type: application/zip