From add3a2d50c7a90e19847e43e5f7ad9c923e8b486 Mon Sep 17 00:00:00 2001 From: jamaa <90166+jamaa@users.noreply.github.com> Date: Sat, 15 Jul 2023 14:26:46 +0200 Subject: [PATCH] add a release action --- .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..303e7dd9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Publish release + +on: + push: + branches: [ master ] + tags: + - * + pull-request: # for testing only + branches: [ master ] + +jobs: + build-and-release: + runs-on: windows-latest + + steps: + - name: Parse version from latest tag + id: version + uses: release-kit/semver@v2 + - name: Checkout + uses: actions/checkout@v3 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + - name: Create TeeChart license file from secret + uses: lukasa1993/secret-file-action@v1.0.4 + id: teechart-license + with: + secret: ${{ secrets.TEECHARTLICENSE }} + b64-decode: false + - name: Copy TeeChart license file + run: copy ${{ steps.teechart-license.outputs.file }} "source\My Project\TeeChart.licenses" + - name: Build Wave + run: msbuild source\Wave.vbproj -restore -property:Platform=x64 -property:Configuration=Release + - name: Setup VS Dev Environment + uses: seanmiddleditch/gha-setup-vsdevenv@v4 + - name: DisableOutOfProc Fix # see https://stackoverflow.com/a/75641385 + run: | + function Invoke-DisableOutOfProcBuild { + param (); + $visualStudioWherePath = ('{0}/Microsoft Visual Studio/Installer/vswhere.exe' -f ${Env:ProgramFiles(x86)}); + $visualStudioInstallationPath = & $visualStudioWherePath -latest -products 'Microsoft.VisualStudio.Product.Enterprise' -property 'installationPath'; + $currentWorkingDirectory = ('{0}/Common7/IDE/CommonExtensions/Microsoft/VSI/DisableOutOfProcBuild' -f $visualStudioInstallationPath); + + Set-Location -Path $currentWorkingDirectory; + + $disableOutOfProcBuildPath = ('{0}/DisableOutOfProcBuild.exe' -f $currentWorkingDirectory); + + & $disableOutOfProcBuildPath; + + return; + } + Invoke-DisableOutOfProcBuild + - name: Build installer + run: devenv.com setup\Wave.Setup.vdproj /build "Release|x64" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: setup\release\BlueM.Wave_x64.msi + asset_name: BlueM.Wave_${{ steps.version.outputs.full }}_x64.msi + asset_content_type: application/x-msi \ No newline at end of file