mirror of
				https://github.com/vsariola/sointu.git
				synced 2025-10-31 07:54:26 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			150 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			150 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Binaries
 | |
| 
 | |
| on:
 | |
|   push:
 | |
|     branches:
 | |
|       - master
 | |
|       - dev
 | |
|     tags:
 | |
|       - 'v*'
 | |
|   pull_request:
 | |
|     branches:
 | |
|       - master
 | |
|       - dev
 | |
| 
 | |
| jobs:
 | |
|   create_release:
 | |
|     name: Create release
 | |
|     runs-on: ubuntu-latest
 | |
|     # Note this. We are going to use that in further jobs.
 | |
|     outputs:
 | |
|       upload_url: ${{ steps.create_release.outputs.upload_url }}
 | |
|     steps:
 | |
|       - uses: actions/checkout@v2
 | |
|       - name: Create release
 | |
|         id: create_release
 | |
|         uses: actions/create-release@v1
 | |
|         env:
 | |
|           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|         with:
 | |
|           tag_name: ${{ github.ref }}
 | |
|           release_name: ${{ github.ref_name }}
 | |
|           body_path: CHANGELOG.md
 | |
|           draft: false
 | |
|           prerelease: false
 | |
|         if: startsWith(github.ref, 'refs/tags/')
 | |
|   binaries:
 | |
|     needs: create_release # we need to know the upload URL
 | |
|     runs-on: ${{ matrix.config.os }}
 | |
|     strategy:
 | |
|       matrix:
 | |
|         config:
 | |
|           - os: windows-latest
 | |
|             asmnasm: C:\Users\runneradmin\nasm\nasm
 | |
|             output: sointu-track.exe
 | |
|             params: -ldflags -H=windowsgui cmd/sointu-track/main.go
 | |
|           - os: windows-latest
 | |
|             asmnasm: C:\Users\runneradmin\nasm\nasm
 | |
|             output: sointu-compile.exe
 | |
|             params: cmd/sointu-compile/main.go
 | |
|           - os: windows-latest
 | |
|             asmnasm: C:\Users\runneradmin\nasm\nasm
 | |
|             output: sointu-track-native.exe
 | |
|             params: -ldflags -H=windowsgui -tags=native cmd/sointu-track/main.go
 | |
|           - os: windows-latest
 | |
|             asmnasm: C:\Users\runneradmin\nasm\nasm
 | |
|             output: sointu-vsti.dll
 | |
|             params: -buildmode=c-shared -tags=plugin ./cmd/sointu-vsti/
 | |
|           - os: windows-latest
 | |
|             asmnasm: C:\Users\runneradmin\nasm\nasm
 | |
|             output: sointu-vsti-native.dll
 | |
|             params: -buildmode=c-shared -tags="plugin,native" ./cmd/sointu-vsti/
 | |
|           - os: ubuntu-latest
 | |
|             asmnasm: /home/runner/nasm/nasm
 | |
|             output: sointu-track
 | |
|             params: cmd/sointu-track/main.go
 | |
|             packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
 | |
|           - os: ubuntu-latest
 | |
|             asmnasm: /home/runner/nasm/nasm
 | |
|             output: sointu-compile
 | |
|             params: cmd/sointu-compile/main.go
 | |
|             packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
 | |
|           - os: ubuntu-latest
 | |
|             asmnasm: /home/runner/nasm/nasm
 | |
|             output: sointu-track-native
 | |
|             params: -tags=native cmd/sointu-track/main.go
 | |
|             packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
 | |
|           - os: macos-latest
 | |
|             asmnasm: /Users/runner/nasm/nasm
 | |
|             output: sointu-track
 | |
|             params: cmd/sointu-track/main.go
 | |
|           - os: macos-latest
 | |
|             asmnasm: /Users/runner/nasm/nasm
 | |
|             output: sointu-compile
 | |
|             params: cmd/sointu-compile/main.go
 | |
|           - os: macos-latest
 | |
|             asmnasm: /Users/runner/nasm/nasm
 | |
|             output: sointu-track-native
 | |
|             params: -tags=native cmd/sointu-track/main.go
 | |
|     steps:
 | |
|     - uses: benjlevesque/short-sha@v2.2
 | |
|       id: short-sha
 | |
|       with:
 | |
|         length: 7
 | |
|     - uses: lukka/get-cmake@v3.18.3
 | |
|     - uses: actions/setup-go@v2
 | |
|     - uses: actions/checkout@v2
 | |
|     - uses: ilammy/setup-nasm@v1.4.0
 | |
|     - uses: awalsh128/cache-apt-pkgs-action@latest
 | |
|       with:
 | |
|         packages: ${{ matrix.config.packages }}
 | |
|         version: 1.0
 | |
|       if: runner.os == 'Linux'
 | |
|     - name: Build library
 | |
|       env:
 | |
|         ASM_NASM: ${{ matrix.config.asmnasm }}
 | |
|       run: |
 | |
|         mkdir build
 | |
|         cd build
 | |
|         cmake -GNinja ..
 | |
|         ninja sointu
 | |
|     - name: Build binary
 | |
|       run: |
 | |
|         go build -o ${{ matrix.config.output }} ${{ matrix.config.params }}
 | |
|     - name: Upload binary
 | |
|       uses: actions/upload-artifact@v3
 | |
|       with:
 | |
|         name: sointu-${{ runner.os }}-${{ steps.short-sha.outputs.sha }}
 | |
|         path: ${{ matrix.config.output }}
 | |
|   upload_release_asset:
 | |
|     needs: [create_release, binaries]
 | |
|     runs-on: ubuntu-latest
 | |
|     if: startsWith(github.ref, 'refs/tags/')
 | |
|     strategy:
 | |
|       matrix:
 | |
|         config:
 | |
|           - os: Windows
 | |
|           - os: Linux
 | |
|           - os: macOS
 | |
|     steps:
 | |
|     - uses: benjlevesque/short-sha@v2.2
 | |
|       id: short-sha
 | |
|       with:
 | |
|         length: 7
 | |
|     - name: Download artifacts
 | |
|       uses: actions/download-artifact@v3
 | |
|       with:
 | |
|         name: sointu-${{ matrix.config.os }}-${{ steps.short-sha.outputs.sha }}
 | |
|         path: sointu-${{ matrix.config.os }}
 | |
|     - name: Zip binaries
 | |
|       run: |
 | |
|         zip ./sointu-${{ matrix.config.os }}.zip sointu-${{ matrix.config.os }}/*
 | |
|     - name: Upload release assets
 | |
|       uses: actions/upload-release-asset@v1
 | |
|       env:
 | |
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | |
|       with:
 | |
|         upload_url: ${{ needs.create_release.outputs.upload_url }}
 | |
|         asset_name: sointu-${{ matrix.config.os }}.zip
 | |
|         asset_path: ./sointu-${{ matrix.config.os }}.zip
 | |
|         asset_content_type: application/octet-stream |