Skip to content

Commit

Permalink
try implement releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
AnakinRaW committed May 31, 2024
1 parent 62dcd3b commit f21a69b
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 3 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Releasing ModVerify

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

# Builds and tests the solution.
test:
uses: ./.github/workflows/test.yml

pack:
name: Pack
needs: [test]
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Create NetFramework Release
run: dotnet build .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net48 --output ./releases/net48
- name: Create Net Core Release
run: dotnet build .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net8.0 --output ./releases/net8.0
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: Binary Releases
path: ./releases
if-no-files-found: error

deploy:
name: Deploy
if: |
github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: [pack]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: Binary Releases
path: ./releases
- name: Create NET Core zip
# Change into the artifacts directory to avoid including the directory itself in the zip archive
working-directory: YoutubeDownloader/
run: zip -r ./releases/ModVerify-Net8.zip ./releases/net8.0
- uses: dotnet/[email protected]
id: nbgv
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.nbgv.outputs.SemVer2 }}
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: |
./releases/net48/ModVerify.CliApp.exe
./releases/ModVerify-Net8.zip
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Petroglyph Tools .NET Build & Test
name: ModVerify Build & Test

on:
workflow_call:
workflow_dispatch:
push:
branches: [ main ]
branches: [ develop ]
pull_request:
branches: [ main ]
branches: [ develop ]

jobs:
build-test:
Expand Down
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.6.133</Version>
</PackageReference>
</ItemGroup>
</Project>
18 changes: 18 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.0-alpha",
"publicReleaseRefSpec": [
"^refs/heads/main$"
],
"assemblyVersion" : {
"precision": "major"
},
"cloudBuild": {
"buildNumber": {
"enabled": true
}
},
"nugetPackageVersion": {
"semVer": 2
}
}

0 comments on commit f21a69b

Please sign in to comment.