Merge pull request #137 from loganmc10/gopher64 #669
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 | |
| on: | |
| push: | |
| # branches: | |
| # - master | |
| paths-ignore: [ "Examples/**", "*.md", ".gitignore", "LICENSE" ] | |
| pull_request: | |
| paths-ignore: [ "Examples/**", "*.md", ".gitignore", "LICENSE" ] | |
| release: | |
| types: | |
| - created | |
| env: | |
| WINDOWS_ARTIFACT_NAME: UNFLoader-Windows-x86 | |
| LINUX_ARTIFACT_NAME: UNFLoader-Linux-x64 | |
| MACOS_ARTIFACT_NAME: UNFLoader-macOS-arm64 | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| env: | |
| BUILD_CONFIGURATION: Release | |
| BUILD_PLATFORM: Win32 | |
| BUILD_DIRECTORY: ./UNFLoader/Release | |
| # SOLUTION_FILE_PATH: ./UNFLoader/UNFLoader.sln /t:UNFLoader | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Visual Studio 2019 | |
| run: | | |
| cd ".github/windows/" | |
| move vsconfig c:\vsconfig | |
| ./install.bat | |
| - uses: actions/checkout@v4 | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| vsversion: 2019 | |
| - name: Build | |
| working-directory: ${{ env.GITHUB_WORKSPACE }} | |
| run: | | |
| msbuild /m /p:Configuration="${{ env.BUILD_CONFIGURATION }}" /p:Platform="${{ env.BUILD_PLATFORM }}" ./UNFLoader/FlashcartLib_Static.vcxproj /p:OutputPath=. | |
| msbuild /m /p:Configuration="${{ env.BUILD_CONFIGURATION }}" /p:Platform="${{ env.BUILD_PLATFORM }}" ./UNFLoader/UNFLoader.vcxproj /p:OutputPath=. | |
| # set MSBuildEmitSolution=1 | |
| # msbuild /m /p:Configuration="${{ env.BUILD_CONFIGURATION }}" /p:Platform="${{ env.BUILD_PLATFORM }}" ${{ env.SOLUTION_FILE_PATH }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.WINDOWS_ARTIFACT_NAME }} | |
| path: ${{ env.BUILD_DIRECTORY }}/UNFLoader.exe | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| env: | |
| SOURCES_DIRECTORY: ./UNFLoader | |
| BUILD_DIRECTORY: ./UNFLoader | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt-get install libncurses5-dev libncursesw5-dev libftdi1-dev libusb-1.0-0-dev libudev-dev | |
| - name: Build | |
| run: | | |
| cd ${{ env.SOURCES_DIRECTORY }} | |
| make | |
| chmod +x UNFLoader | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.LINUX_ARTIFACT_NAME }} | |
| path: | | |
| ${{ env.BUILD_DIRECTORY }}/UNFLoader | |
| ${{ env.BUILD_DIRECTORY }}/installer_linux.sh | |
| build-macos: | |
| runs-on: macos-latest | |
| env: | |
| SOURCES_DIRECTORY: ./UNFLoader/ | |
| BUILD_DIRECTORY: ./UNFLoader | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build | |
| run: | | |
| echo Installing Prerequisites | |
| brew install libftdi | |
| echo Build macOS App | |
| cd ${{ env.SOURCES_DIRECTORY }} | |
| make | |
| chmod +x UNFLoader | |
| cd .. | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.MACOS_ARTIFACT_NAME }} | |
| path: ${{ env.BUILD_DIRECTORY }}/UNFLoader | |
| release: | |
| if: github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| needs: [build-windows, build-linux, build-macos] | |
| steps: | |
| - name: Download Windows artifact | |
| id: download-windows | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ env.WINDOWS_ARTIFACT_NAME }} | |
| - name: Rezip Windows artifact... | |
| id: rezip-windows | |
| run: | | |
| zip -r ${{ env.WINDOWS_ARTIFACT_NAME }}.zip * -x \*.zip | |
| find . -type f ! -name "*.zip" -exec rm -rf {} \; | |
| - name: Download Linux artifact | |
| id: download-linux | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ env.LINUX_ARTIFACT_NAME }} | |
| - name: Rezip Linux artifact... | |
| id: rezip-linux | |
| run: | | |
| zip -r ${{ env.LINUX_ARTIFACT_NAME }}.zip * -x \*.zip | |
| find . -type f ! -name "*.zip" -exec rm -rf {} \; | |
| - name: Download macOS artifact | |
| id: download-macos | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ env.MACOS_ARTIFACT_NAME }} | |
| - name: Rezip macOS artifact... | |
| id: rezip-macos | |
| run: | | |
| zip -r ${{ env.MACOS_ARTIFACT_NAME }}.zip * -x \*.zip | |
| find . -type f ! -name "*.zip" -exec rm -rf {} \; | |
| - name: Delete already existing Release | |
| id: delete_release | |
| uses: dev-drprasad/delete-tag-and-release@v1.1 | |
| continue-on-error: true | |
| with: | |
| tag_name: pre | |
| delete_release: true | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Wait for GitHub to finish deleting the Release... | |
| run: sleep 5 | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: pre | |
| name: Prerelease | |
| body: | | |
| This prerelease contains the latest build of UNFLoader, generated by GitHub Actions. It might be unstable, hence why it is marked as prerelease! | |
| draft: false | |
| prerelease: true | |
| files: | | |
| ${{ steps.download-windows.outputs.download-path }}/${{ env.WINDOWS_ARTIFACT_NAME }}.zip | |
| ${{ steps.download-windows.outputs.download-path }}/${{ env.LINUX_ARTIFACT_NAME }}.zip | |
| ${{ steps.download-windows.outputs.download-path }}/${{ env.MACOS_ARTIFACT_NAME }}.zip |