Skip to content

Commit f21a69b

Browse files
committed
try implement releasing
1 parent 62dcd3b commit f21a69b

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

.github/workflows/release.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Releasing ModVerify
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
# Builds and tests the solution.
12+
test:
13+
uses: ./.github/workflows/test.yml
14+
15+
pack:
16+
name: Pack
17+
needs: [test]
18+
runs-on: windows-latest
19+
steps:
20+
- name: Checkout sources
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
submodules: recursive
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
- name: Create NetFramework Release
28+
run: dotnet build .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net48 --output ./releases/net48
29+
- name: Create Net Core Release
30+
run: dotnet build .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net8.0 --output ./releases/net8.0
31+
- name: Upload a Build Artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: Binary Releases
35+
path: ./releases
36+
if-no-files-found: error
37+
38+
deploy:
39+
name: Deploy
40+
if: |
41+
github.ref == 'refs/heads/main' && github.event_name == 'push'
42+
needs: [pack]
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: Binary Releases
52+
path: ./releases
53+
- name: Create NET Core zip
54+
# Change into the artifacts directory to avoid including the directory itself in the zip archive
55+
working-directory: YoutubeDownloader/
56+
run: zip -r ./releases/ModVerify-Net8.zip ./releases/net8.0
57+
- uses: dotnet/[email protected]
58+
id: nbgv
59+
- name: Create GitHub release
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
name: v${{ steps.nbgv.outputs.SemVer2 }}
63+
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
generate_release_notes: true
66+
files: |
67+
./releases/net48/ModVerify.CliApp.exe
68+
./releases/ModVerify-Net8.zip

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Petroglyph Tools .NET Build & Test
1+
name: ModVerify Build & Test
22

33
on:
44
workflow_call:
55
workflow_dispatch:
66
push:
7-
branches: [ main ]
7+
branches: [ develop ]
88
pull_request:
9-
branches: [ main ]
9+
branches: [ develop ]
1010

1111
jobs:
1212
build-test:

Directory.Build.props

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
5+
<PrivateAssets>all</PrivateAssets>
6+
<Version>3.6.133</Version>
7+
</PackageReference>
8+
</ItemGroup>
9+
</Project>

version.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "0.0-alpha",
4+
"publicReleaseRefSpec": [
5+
"^refs/heads/main$"
6+
],
7+
"assemblyVersion" : {
8+
"precision": "major"
9+
},
10+
"cloudBuild": {
11+
"buildNumber": {
12+
"enabled": true
13+
}
14+
},
15+
"nugetPackageVersion": {
16+
"semVer": 2
17+
}
18+
}

0 commit comments

Comments
 (0)