Add PREFIX variable to Makefile #579
Workflow file for this run
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: 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-x64 | |
jobs: | |
build-windows: | |
runs-on: windows-2019 | |
env: | |
SOLUTION_FILE_PATH: ./UNFLoader/UNFLoader.sln | |
BUILD_CONFIGURATION: Release | |
BUILD_DIRECTORY: ./UNFLoader/Release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
vs-version: '16.0' | |
msbuild-architecture: x86 | |
- name: Build | |
working-directory: ${{ env.GITHUB_WORKSPACE }} | |
run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} ${{ 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: | |
LIBFTD2XX_VERSION: '1.4.27' | |
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 | |
- 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: | |
LIBFTD2XX_VERSION: '1.4.24' | |
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 | |
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 |