Skip to content

Commit 4620199

Browse files
authored
Merged Release and Build Workflows (#3)
1 parent a5cee8d commit 4620199

File tree

3 files changed

+53
-93
lines changed

3 files changed

+53
-93
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build and Publish Artifacts
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
runtime: [win-x64, osx-x64, osx-arm64, linux-x64]
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Setup .NET 9 SDK
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: '9.0.x'
27+
28+
- name: Restore dependencies
29+
run: dotnet restore
30+
31+
- name: Publish single-file executable for ${{ matrix.runtime }}
32+
run: |
33+
dotnet publish src/CLI \
34+
-c Release \
35+
-r ${{ matrix.runtime }} \
36+
--self-contained true \
37+
/p:PublishSingleFile=true \
38+
/p:IncludeAllContentForSelfExtract=true \
39+
-o ./publish/${{ matrix.runtime }}
40+
41+
- name: Upload artifact for ${{ matrix.runtime }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: DrumMidiRemapper-${{ matrix.runtime }}
45+
path: ./publish/${{ matrix.runtime }}
46+
47+
- name: Upload Release Asset
48+
if: startsWith(github.ref, 'refs/tags/v')
49+
uses: softprops/action-gh-release@v2
50+
with:
51+
files: ./publish/${{ matrix.runtime }}/CLI*
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

β€Ž.github/workflows/build.ymlβ€Ž

Lines changed: 0 additions & 35 deletions
This file was deleted.

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
Β (0)