diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml new file mode 100644 index 00000000..508188b4 --- /dev/null +++ b/.github/actions/macos/action.yml @@ -0,0 +1,20 @@ +name: macOS +description: Build macOS builds +runs: + using: "composite" + steps: + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release + - name: copy binary + shell: bash + run: cp target/release/neothesia .github/app/Neothesia.app/Contents/MacOS + - name: zip binary + shell: bash + run: cd .github/app/ && zip -r app.zip Neothesia.app && cd ../.. + - uses: actions/upload-artifact@v2 + with: + name: macos-artifact + path: .github/app/app.zip diff --git a/.github/actions/ubuntu-recorder/action.yml b/.github/actions/ubuntu-recorder/action.yml new file mode 100644 index 00000000..6b480bb1 --- /dev/null +++ b/.github/actions/ubuntu-recorder/action.yml @@ -0,0 +1,23 @@ +name: Ubuntu Recorder +description: Build ubuntu recorder builds +runs: + using: "composite" + steps: + - name: Install alsa + shell: bash + run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release -p neothesia-cli + - name: Chmod +x + shell: bash + run: chmod +x target/release/neothesia-cli + - name: zip binary + shell: bash + run: zip -rj app.zip target/release/neothesia-cli + - uses: actions/upload-artifact@v2 + with: + name: ubuntu-recorder-artifact + path: app.zip diff --git a/.github/actions/ubuntu/action.yml b/.github/actions/ubuntu/action.yml new file mode 100644 index 00000000..1ed6a326 --- /dev/null +++ b/.github/actions/ubuntu/action.yml @@ -0,0 +1,23 @@ +name: Ubuntu +description: Build ubuntu builds +runs: + using: "composite" + steps: + - name: Install alsa + shell: bash + run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release + - name: Chmod +x + shell: bash + run: chmod +x target/release/neothesia + - name: zip binary + shell: bash + run: zip -rj app.zip target/release/neothesia + - uses: actions/upload-artifact@v2 + with: + name: ubuntu-artifact + path: app.zip diff --git a/.github/actions/windows-recorder/action.yml b/.github/actions/windows-recorder/action.yml new file mode 100644 index 00000000..16d96bd1 --- /dev/null +++ b/.github/actions/windows-recorder/action.yml @@ -0,0 +1,27 @@ +name: Windows +description: Build Windows builds + +runs: + using: "composite" + steps: + - name: Install dependencies + shell: cmd + run: | + $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath) + Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n" + Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z + 7z x ffmpeg-release-full-shared.7z + mkdir ffmpeg + mv ffmpeg-*/* ffmpeg/ + Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n" + Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n" + + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release -p neothesia-cli + - uses: actions/upload-artifact@v2 + with: + name: windows-recorder-artifact + path: target/release/neothesia-cli.exe diff --git a/.github/actions/windows/action.yml b/.github/actions/windows/action.yml new file mode 100644 index 00000000..33541406 --- /dev/null +++ b/.github/actions/windows/action.yml @@ -0,0 +1,14 @@ +name: Windows +description: Build Windows builds +runs: + using: "composite" + steps: + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release + - uses: actions/upload-artifact@v2 + with: + name: windows-artifact + path: target/release/neothesia.exe diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 71fa24f9..a72faa55 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,79 +2,33 @@ name: Rust on: [push, pull_request] -env: - MACOSX_DEPLOYMENT_TARGET: 10.12 - jobs: build_ubuntu: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install alsa - run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: Chmod +x - run: chmod +x target/release/neothesia - - name: zip binary - run: zip -rj app.zip target/release/neothesia - - uses: actions/upload-artifact@v2 - with: - name: ubuntu-artifact - path: app.zip - build_windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - uses: actions/upload-artifact@v2 - with: - name: windows-artifact - path: target/release/neothesia.exe - build_macos: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - name: copy binary - run: cp target/release/neothesia .github/app/Neothesia.app/Contents/MacOS - - name: zip binary - run: cd .github/app/ && zip -r app.zip Neothesia.app && cd ../.. - - uses: actions/upload-artifact@v2 - with: - name: macos-artifact - path: .github/app/app.zip + - id: Build + uses: ./.github/actions/ubuntu + - name: ls + run: ls -l app.zip build_ubuntu_recorder: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install alsa - run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release -p neothesia-cli - - name: Chmod +x - run: chmod +x target/release/neothesia-cli - - name: zip binary - run: zip -rj app.zip target/release/neothesia-cli - - uses: actions/upload-artifact@v2 - with: - name: ubuntu-recorder-artifact - path: app.zip + - id: Build + uses: ./.github/actions/ubuntu-recorder + - name: ls + run: ls -l app.zip + + build_windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - id: Build + uses: ./.github/actions/windows + - name: ls + run: ls -l target/release/neothesia.exe build_windows_recorder: runs-on: windows-latest @@ -84,24 +38,21 @@ jobs: steps: - uses: actions/checkout@v2 + - id: Build + uses: ./.github/actions/windows-recorder + - name: ls + run: ls -l target/release/neothesia-cli.exe + + build_macos: + runs-on: macos-latest + + env: + MACOSX_DEPLOYMENT_TARGET: 10.12 - - name: Install dependencies - run: | - $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath) - Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n" - Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z - 7z x ffmpeg-release-full-shared.7z - mkdir ffmpeg - mv ffmpeg-*/* ffmpeg/ - Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n" - Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n" + steps: + - uses: actions/checkout@v2 + - id: Build + uses: ./.github/actions/macos + - name: ls + run: ls -l .github/app/app.zip - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release -p neothesia-cli - - uses: actions/upload-artifact@v2 - with: - name: windows-recorder-artifact - path: target/release/neothesia-cli.exe