Skip to content

Commit

Permalink
new two step build script with release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
FreedomFaighter committed Oct 28, 2023
1 parent eeba656 commit 08c4e00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ on:
- "0.*.*.*"
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
dotnetFrameworkVersion: ['4.7.2', '4.8']
env:
ACTFileName: 'ACTv3-setup.exe'
ACTDownloadURI: 'https://advancedcombattracker.com/download.php?id=56'
EQDPSPluginUnitTestLibraryPath: '.\EQDPSPluginUnitTests\bin\Release\EQDPSPluginUnitTests.dll'
EQDPSPluginLibraryPath: ".\EverQuestDPSPlugin\obj\Release\EverQuestDPSPlugin.dll"
steps:
- uses: actions/checkout@main
- name: Setup MSBuild
Expand All @@ -38,7 +35,7 @@ jobs:
- name: Restore nuget packages
run: nuget restore EverQuestDPSPlugin.sln
- name: Build solution
run: msbuild -t:rebuild -property:Configuration=Release /p:TargetFrameworkVersion=v${{ matrix.dotnetFrameworkVersion }} EverQuestDPSPlugin.sln
run: msbuild -t:build -property:Configuration=Release /p:TargetFrameworkVersion=v4.8 EverQuestDPSPlugin.sln
- name: Test solution
run: '& "$(vswhere -property installationPath)\Common7\IDE\MSTest.exe" /testcontainer:${{env.EQDPSPluginUnitTestLibraryPath}}'
- name: Test Success
Expand Down Expand Up @@ -68,25 +65,34 @@ jobs:
details: Test Cancelled!
text: ACT EverQuest DPS Plugin .NET Framework Version ${{ matrix.dotnetFrameworkVersion }}
webhookUrl: ${{ secrets.ACT_EQ_DISCORD_WEBHOOK }}
- uses: actions/upload-artifact@v2
with:
name: EQDPSPluginPath
path: ${{ env.EQDPSPluginLibraryPath }}
release:
needs: build
if: github.ref_type == 'tag'
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
if: github.ref_type == 'tag' && ${{ matrix.dotnetFrameworkVersion }} == '4.8'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- uses: actions/download-artifact@v2
with:
name: EQDPSPluginPath
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
if: github.ref_type == 'tag' && ${{ matrix.dotnetFrameworkVersion }} == '4.8'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: .\EverQuestDPSPlugin\obj\Release\EverQuestDPSPlugin.dll
asset_path: .\EverQuestDPSPlugin.dll
asset_name: EverQuestDPSPlugin.dll
asset_content_type: application/dll
2 changes: 1 addition & 1 deletion EverQuestDPSPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.1.0.33")]
[assembly: AssemblyVersion("0.1.0.34")]
[assembly: InternalsVisibleTo("EQDPSPluginUnitTests")]

0 comments on commit 08c4e00

Please sign in to comment.