Skip to content

Build sshfs-win automatically #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build

on:
push:
pull_request:

jobs:
build:
runs-on: windows-latest

steps:
- name: Configure Git line endings
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Download WinFSP
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi'

- name: WinFSP installation
run: msiexec /i winfsp-2.1.25156.msi /quiet /qn /norestart /log install.log ADDLOCAL=ALL

- name: Setup Cygwin environment
uses: cygwin/cygwin-install-action@v4
with:
platform: x86_64
packages: gcc-core,git,libglib2.0-devel,make,meson,patch
add-to-path: false

- name: Install cygfuse
shell: C:\cygwin\bin\bash.exe --login {0}
run:
bash "/cygdrive/c/Program Files (x86)/WinFsp/opt/cygfuse/install.sh"



- name: Build SSHFS-Win
shell: C:\cygwin\bin\bash.exe --login "/cygdrive/d/a/sshfs-win/sshfs-win/.github/workflows/run-converted.sh" {0}
run: |
cd "${{ github.workspace }}"
make

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: sshfs-binaries
path: ${{ github.workspace }}/.build
include-hidden-files: true
24 changes: 24 additions & 0 deletions .github/workflows/run-converted.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Check if filename is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <script-file>"
exit 1
fi

filename=$(cygpath -u "$1")

# Check if file exists
if [ ! -f "$filename" ]; then
echo "Error: File '$filename' not found"
exit 1
fi

# Convert line endings using sed (in-place conversion)
dos2unix "$filename" 2>/dev/null || sed -i 's/\r$//' "$filename"

# Make file executable (if not already)
chmod +x "$filename"

# Execute the script
"$filename"