diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..222c280 --- /dev/null +++ b/.github/workflows/release.yml @@ -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/nbgv@v0.4.2 + 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 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a34d7ac..20a36cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..1dda2dd --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + all + 3.6.133 + + + \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 0000000..251e6e2 --- /dev/null +++ b/version.json @@ -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 + } +} \ No newline at end of file