diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd86f8a..a2269c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ jobs: compile_exec: name: Compile to executables runs-on: ${{ matrix.config.os }} - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/rewrite' # just to see if it works strategy: matrix: config: @@ -13,14 +13,20 @@ jobs: - os: windows-latest steps: - uses: actions/checkout@v3 - - name: Setup python - uses: actions/setup-python@v3 + - name: Setup Rust + - uses: actions-rs/toolchain@v1 with: - python-version: '3.9' - - name: Install dependencies for ${{ matrix.config.os }} - run: | - python -m pip install --upgrade pip wheel setuptools - pip install -r requirements.txt - pip install pyinstaller - - name: Build with pyinstaller for ${{ matrix.config.os }} - run: pyinstaller popcorn.spec \ No newline at end of file + toolchain: stable + + - name: Install dependencies on Ubuntu + if: startsWith(matrix.config.os, 'ubuntu') + run: sudo apt-get update && sudo apt-get install cmake pkg-config libgtk-3-dev + + - name: Update toolchain + run: rustup update + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Build with Cargo + run: cargo build \ No newline at end of file diff --git a/.github/workflows/compile_and_release.yml b/.github/workflows/compile_and_release.yml index d745fc7..2be8bf0 100644 --- a/.github/workflows/compile_and_release.yml +++ b/.github/workflows/compile_and_release.yml @@ -54,17 +54,37 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # [!] we need to checkout with tags and commit history - - name: Setup python - uses: actions/setup-python@v3 + - uses: actions/checkout@v3 + - name: Setup Rust + - uses: actions-rs/toolchain@v1 with: - python-version: '3.9' - - name: Install dependencies for ${{ matrix.config.os }} - run: | - python -m pip install --upgrade pip wheel setuptools - pip install -r requirements.txt - pip install pyinstaller - - name: Build with pyinstaller for ${{ matrix.config.os }} - run: pyinstaller popcorn.spec + toolchain: stable + + - name: Install dependencies on Ubuntu + if: startsWith(matrix.config.os, 'ubuntu') + run: sudo apt-get update && sudo apt-get install cmake pkg-config libgtk-3-dev + + - name: Build with Cargo for ${{ matrix.config.os }} + if: startsWith(matrix.config.os, 'ubuntu') + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-gnu + run: cargo build --release --target $TARGET + + if: startsWith(matrix.config.os, 'macos') + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-apple-darwin # will probably have to change this around to accomodate for M1 & M2 + run: cargo build --release --target $TARGET + + if: startsWith(matrix.config.os, 'windows') # not sure if a target is needed here + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + run: cargo build --release + - name: Copy files to be compressed run: | cp README.md ./dist