Merge pull request #104 from divadiow/relaxednew #252
This file contains hidden or 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: Build and Release BK7231GUIFlashTool | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| env: | |
| FLASHERVERSION: ${{ github.run_number }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up MSBuild | |
| uses: microsoft/setup-msbuild@v1 | |
| - name: Create Output Directory | |
| run: mkdir -p BuildOutput/Release | |
| - name: Build the project | |
| run: msbuild BK7231Flasher/BK7231Flasher.csproj /p:Configuration=Release /p:OutDir=BuildOutput\Release\ | |
| - name: Debug Build Output | |
| run: | | |
| echo "Checking output directory..." | |
| dir BuildOutput | |
| dir BuildOutput\Release | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: BK7231GUIFlashTool | |
| path: | | |
| BK7231Flasher/BuildOutput/Release/*.exe | |
| BK7231Flasher/BuildOutput/Release/*.dll | |
| BK7231Flasher/BuildOutput/Release/easyflash/*.dll | |
| BK7231Flasher/BuildOutput/Release/easyflash/*.so | |
| if-no-files-found: warn | |
| - name: Debug Build Output Directory | |
| run: | | |
| echo "Contents of BuildOutput/Release:" | |
| dir BK7231Flasher/BuildOutput/Release | |
| release: | |
| needs: build | |
| runs-on: windows-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: BK7231GUIFlashTool | |
| - name: Recreate Directory Structure | |
| run: | | |
| echo "Recreating BuildOutput directory..." | |
| mkdir -p BuildOutput/Release | |
| move *.exe BuildOutput/Release/ | |
| move *.dll BuildOutput/Release/ | |
| move easyflash BuildOutput/Release | |
| #- name: Copy loaders directory into release | |
| # run: | | |
| # echo "Copying /loaders/ into BuildOutput/Release..." | |
| # xcopy loaders BuildOutput\Release\loaders /E /I /Y | |
| - name: Debug Downloaded Artifacts | |
| run: | | |
| echo "Downloaded artifacts in BuildOutput/Release:" | |
| dir BuildOutput/Release | |
| #echo "Contents of loaders:" | |
| #dir BuildOutput/Release/loaders | |
| - name: Create ZIP File | |
| run: | | |
| mkdir release | |
| powershell Compress-Archive -Path "BuildOutput/Release/*" -DestinationPath "release/BK7231GUIFlashTool-build-${{ github.run_number }}.zip" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| name: BK7231GUIFlashTool build ${{ github.run_number }} | |
| body: | | |
| Automated release for BK7231GUIFlashTool. | |
| Includes the latest .exe, .dll files, and loaders directory. | |
| draft: false | |
| prerelease: false | |
| files: release/BK7231GUIFlashTool-build-${{ github.run_number }}.zip |