From d5141b2ba4a04fc77b5c03e09a7b220892a19fbf Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Thu, 17 Jul 2025 12:31:25 +0800 Subject: [PATCH 1/2] Add workflow to build project --- .github/workflows/build.yml | 74 ++++++++++++++++++++++++++++++ .github/workflows/run-converted.sh | 24 ++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/run-converted.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bd85d1e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,74 @@ +# 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: Download a file + uses: carlosperate/download-file-action@v2 + with: + file-url: 'https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi' + + - name: Build + working-directory: ${{ github.workspace }} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msiexec /i winfsp-2.1.25156.msi /quiet /qn /norestart /log install.log ADDLOCAL=ALL + + - name: Build + working-directory: ${{ github.workspace }} + run: cat install.log + + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v4 + + - name: Build + working-directory: ${{ github.workspace }} + run: git submodule update --init sshfs + + - name: Install Cygwin Action + uses: cygwin/cygwin-install-action@v4 + with: + add-to-path: 'false' + packages: gcc-core,git,libglib2.0-devel,make,meson,patch + + + + - name: Build + working-directory: ${{ github.workspace }} + shell: C:\cygwin\bin\bash.exe --login {0} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: + bash "/cygdrive/c/Program Files (x86)/WinFsp/opt/cygfuse/install.sh" + + + + - name: Build + working-directory: ${{ github.workspace }} + shell: C:\cygwin\bin\bash.exe --login "/cygdrive/d/a/sshfs-win/sshfs-win/.github/workflows/run-converted.sh" {0} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: | + cd "/cygdrive/d/a/sshfs-win/sshfs-win/" + make + + - uses: actions/upload-artifact@v4 + with: + name: my-artifact + path: D:\a\sshfs-win\sshfs-win\.build # or path/to/artifact + include-hidden-files: 'true' diff --git a/.github/workflows/run-converted.sh b/.github/workflows/run-converted.sh new file mode 100644 index 0000000..7f7d3db --- /dev/null +++ b/.github/workflows/run-converted.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Check if filename is provided +if [ $# -ne 1 ]; then + echo "Usage: $0 " + 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" From ae553259e505f8270a08eb161194ddb8aa1aaee7 Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Thu, 17 Jul 2025 12:42:17 +0800 Subject: [PATCH 2/2] Clean workflow with AI --- .github/workflows/build.yml | 60 ++++++++++++++----------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd85d1e..8626763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,61 +14,47 @@ jobs: runs-on: windows-latest steps: - - name: Download a file + - 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: Build - working-directory: ${{ github.workspace }} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + - name: WinFSP installation run: msiexec /i winfsp-2.1.25156.msi /quiet /qn /norestart /log install.log ADDLOCAL=ALL - - name: Build - working-directory: ${{ github.workspace }} - run: cat install.log - - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: actions/checkout@v4 - - - name: Build - working-directory: ${{ github.workspace }} - run: git submodule update --init sshfs - - - name: Install Cygwin Action + - name: Setup Cygwin environment uses: cygwin/cygwin-install-action@v4 with: - add-to-path: 'false' + platform: x86_64 packages: gcc-core,git,libglib2.0-devel,make,meson,patch + add-to-path: false - - - - name: Build - working-directory: ${{ github.workspace }} + - name: Install cygfuse shell: C:\cygwin\bin\bash.exe --login {0} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: bash "/cygdrive/c/Program Files (x86)/WinFsp/opt/cygfuse/install.sh" - - name: Build - working-directory: ${{ github.workspace }} + - name: Build SSHFS-Win shell: C:\cygwin\bin\bash.exe --login "/cygdrive/d/a/sshfs-win/sshfs-win/.github/workflows/run-converted.sh" {0} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: | - cd "/cygdrive/d/a/sshfs-win/sshfs-win/" + cd "${{ github.workspace }}" make - - uses: actions/upload-artifact@v4 + - name: Upload build artifacts + uses: actions/upload-artifact@v4 with: - name: my-artifact - path: D:\a\sshfs-win\sshfs-win\.build # or path/to/artifact - include-hidden-files: 'true' + name: sshfs-binaries + path: ${{ github.workspace }}/.build + include-hidden-files: true