Merge pull request #3 from AlamoEngine-Tools/develop #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 publish .\src\ModVerify.CliApp\ModVerify.CliApp.csproj --configuration Release -f net48 --output ./releases/net48 | |
- name: Create Net Core Release | |
run: dotnet publish .\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 | |
retention-days: 1 | |
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: ./releases/net8.0 | |
run: zip -r ../ModVerify-Net8.zip . | |
- name: Rename .NET Framework executable | |
run: mv ./releases/net48/ModVerify.CliApp.exe ./releases/net48/ModVerify.exe | |
- 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.exe | |
./releases/ModVerify-Net8.zip |