From 46dee8c8a1fd5545a7588d9da4f1ada09b10f02a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 20 Jul 2024 16:30:45 +0100 Subject: [PATCH 1/4] replace broken linux build with one that works. remove broken windows build. --- .github/workflows/build.yml | 89 ++++++------------------------------- 1 file changed, 13 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf9089df..41babbcb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,85 +9,22 @@ on: branches: [ master ] jobs: - build-docker: - runs-on: ubuntu-latest - container: docker://hhmhh/weylus_build:latest + build-linux: + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: deps/dist* - key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }} - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - - name: Build - run: ./docker_build.sh - shell: bash - - name: Artifacts1 - uses: actions/upload-artifact@v2 - with: - name: linux - path: packages/weylus-linux.zip - - name: Artifacts2 - uses: actions/upload-artifact@v2 - with: - name: linux-deb - path: packages/Weylus*.deb - - name: Artifacts3 - uses: actions/upload-artifact@v3 - with: - name: windows - path: packages/weylus-windows.zip - - name: Publish - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - packages/weylus-linux.zip - packages/Weylus*.deb - packages/weylus-windows.zip - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - build-docker-alpine: - runs-on: ubuntu-latest - container: docker://hhmhh/weylus_build_alpine:latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: deps/dist* - key: ${{ runner.os }}-alpine-deps-${{ hashFiles('deps/*') }} - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-alpine-cargo-${{ hashFiles('Cargo.lock') }} + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Build - run: cargo build --release && cd target/release && tar czf weylus-linux-alpine-musl.tar.gz weylus - shell: bash - - name: Artifacts1 - uses: actions/upload-artifact@v2 - with: - name: linux-alpine-musl - path: target/release/weylus-linux-alpine-musl.tar.gz - - name: Publish - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - target/release/weylus-linux-alpine-musl.tar.gz - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + sudo apt-get install -y libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libxtst-dev libxrandr-dev libxcomposite-dev libxi-dev libxv-dev autoconf libtool-bin nvidia-cuda-dev pkg-config libdrm-dev libpango1.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-1-dev libavcodec-dev libavformat-dev libswscale-dev libva-dev libavdevice-dev libavfilter-dev libpostproc-dev libx264-dev + RUSTFLAGS="$RUSTFLAGS -A dead_code -A unused_imports" cargo b --features ffmpeg-system --release + mv target/release/weylus . + tar -czvf weylus_linux.tar.gz weylus + - name: Upload tar + uses: actions/upload-artifact@v2.2.4 + with: + name: weylus_linux + path: weylus_linux.tar.gz build-macos: runs-on: macOS-latest From d34a03890496c003dea35f212b675de9cb2895f7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 29 Jul 2024 16:03:50 +0100 Subject: [PATCH 2/4] macos intel build by @lyonbot --- .github/workflows/build.yml | 105 +++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41babbcb..3bd5e9e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,57 +27,62 @@ jobs: path: weylus_linux.tar.gz build-macos: - runs-on: macOS-latest + strategy: + matrix: + os: [ macos-latest, macos-13 ] # -latest if for Apple Silicon, -13 is for Intel + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: deps/dist - key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }} - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - - name: Download deps - run: | - npm install -g typescript - brew install nasm - cargo install cargo-bundle - shell: bash - - name: Build - # run: MACOSX_DEPLOYMENT_TARGET=10.13 cargo bundle --release - run: cargo bundle --release - - name: Package - run: cd target/release/bundle/osx/ && zip -r macOS.zip Weylus.app - - name: Artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }} - path: | - target/release/bundle/osx/macOS.zip - - name: ArtifactsDebug - if: failure() - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }}-ffbuild - path: | - deps/ffmpeg/ffbuild - - name: Debug via SSH - if: failure() - uses: luchihoratiu/debug-via-ssh@main - with: - NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} - SSH_PASS: ${{ secrets.SSH_PASS }} - NGROK_REGION: eu - - name: Publish - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: deps/dist + key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }} + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + - name: Download deps + run: | + npm install -g typescript + brew install nasm + cargo install cargo-bundle + shell: bash + - name: Build + # run: MACOSX_DEPLOYMENT_TARGET=10.13 cargo bundle --release + run: cargo bundle --release + - name: Package + run: | + MACOS_BUILD_NAME=macos-$([ "${{ matrix.os }}" == "macos-latest" ] && echo "arm" || echo "intel") + echo "MACOS_BUILD_NAME=$MACOS_BUILD_NAME" >> $GITHUB_ENV + cd target/release/bundle/osx/ && zip -r ${MACOS_BUILD_NAME}.zip Weylus.app + - name: Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.MACOS_BUILD_NAME }} + path: target/release/bundle/osx/${{ env.MACOS_BUILD_NAME }}.zip + - name: ArtifactsDebug + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-ffbuild + path: | + deps/ffmpeg/ffbuild + - name: Debug via SSH + if: failure() + uses: luchihoratiu/debug-via-ssh@main + with: + NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} + SSH_PASS: ${{ secrets.SSH_PASS }} + NGROK_REGION: eu + - name: Publish + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: files: | target/release/bundle/osx/macOS.zip prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 46c7ea2a4eb230e46139e53bf6837162053feb03 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 29 Jul 2024 16:23:52 +0100 Subject: [PATCH 3/4] windows build --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ build.rs | 4 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bd5e9e0..998cfc47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,40 @@ on: pull_request: branches: [ master ] + + + + jobs: + build-windows: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Build + run: | + choco install -y --no-progress nodejs.install + npm install -g typescript + choco install -y --no-progress 7zip + Invoke-WebRequest -Uri https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-6.1.1-full_build-shared.7z -OutFile ffmpeg.7z + 7z x ffmpeg.7z + $env:INCLUDE = ".\ffmpeg-6.1.1-full_build-shared\include\;" + $env:INCLUDE + $env:LIB = ".\ffmpeg-6.1.1-full_build-shared\lib\;" + $env:LIB + Invoke-WebRequest -Uri https://github.com/ShiftMediaProject/x264/releases/download/0.164.r3191/libx264_0.164.r3191_msvc17.zip -OutFile x264.zip + 7z x x264.zip -ox264 + $env:LIB = ".\x264\lib\x64\;" + $env:LIB + $env:RUSTFLAGS="$RUSTFLAGS -A dead_code -A unused_imports" + cargo b --features ffmpeg-system --release + mkdir weylus + cp .\ffmpeg-6.1.1-full_build-shared\bin\* weylus + cp .\target\release\weylus.exe weylus + 7z a weylus_windows.7z weylus\* + - name: Upload 7zip + uses: actions/upload-artifact@v2.2.4 + with: + name: weylus_windows + path: weylus_windows.7z + build-linux: runs-on: ubuntu-20.04 steps: diff --git a/build.rs b/build.rs index 35787941..c03d0b1f 100644 --- a/build.rs +++ b/build.rs @@ -44,9 +44,9 @@ fn main() { let mut tsc_command = Command::new("tsc"); #[cfg(target_os = "windows")] - let mut tsc_command = Command::new("bash"); + let mut tsc_command = Command::new("cmd"); #[cfg(target_os = "windows")] - tsc_command.args(&["-c", "tsc"]); + tsc_command.args(&["/c", "tsc"]); let js_needs_update = || -> Result> { Ok(Path::new("ts/lib.ts").metadata()?.modified()? From 20122e038541b52416585e8d265a4c549545b651 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 29 Jul 2024 17:09:04 +0100 Subject: [PATCH 4/4] use same name for artifacts --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 998cfc47..9f0081cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: choco install -y --no-progress 7zip Invoke-WebRequest -Uri https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-6.1.1-full_build-shared.7z -OutFile ffmpeg.7z 7z x ffmpeg.7z + del .\ffmpeg-6.1.1-full_build-shared\bin\*.exe $env:INCLUDE = ".\ffmpeg-6.1.1-full_build-shared\include\;" + $env:INCLUDE $env:LIB = ".\ffmpeg-6.1.1-full_build-shared\lib\;" + $env:LIB Invoke-WebRequest -Uri https://github.com/ShiftMediaProject/x264/releases/download/0.164.r3191/libx264_0.164.r3191_msvc17.zip -OutFile x264.zip @@ -37,9 +38,9 @@ jobs: cp .\target\release\weylus.exe weylus 7z a weylus_windows.7z weylus\* - name: Upload 7zip - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 with: - name: weylus_windows + name: weylus path: weylus_windows.7z build-linux: @@ -54,9 +55,9 @@ jobs: mv target/release/weylus . tar -czvf weylus_linux.tar.gz weylus - name: Upload tar - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 with: - name: weylus_linux + name: weylus path: weylus_linux.tar.gz build-macos: @@ -88,13 +89,13 @@ jobs: run: cargo bundle --release - name: Package run: | - MACOS_BUILD_NAME=macos-$([ "${{ matrix.os }}" == "macos-latest" ] && echo "arm" || echo "intel") + MACOS_BUILD_NAME=weylus-macos-$([ "${{ matrix.os }}" == "macos-latest" ] && echo "arm" || echo "intel") echo "MACOS_BUILD_NAME=$MACOS_BUILD_NAME" >> $GITHUB_ENV cd target/release/bundle/osx/ && zip -r ${MACOS_BUILD_NAME}.zip Weylus.app - name: Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: ${{ env.MACOS_BUILD_NAME }} + name: weylus path: target/release/bundle/osx/${{ env.MACOS_BUILD_NAME }}.zip - name: ArtifactsDebug if: failure()