Skip to content

Commit

Permalink
chore: bump fairos (#36)
Browse files Browse the repository at this point in the history
* chore: bump fairos

* chore: bump linter version

* feat: add wails app (#37)

* feat: add wails app

* refactor fuse for multiple mounts, material-ui working on wails

* added info for installer, updated readme for windows dev and build procedure

* changing material to mui, changing styled engin

* remove cli code, add config, login and mount placeholders

* comment out build code

* update menu

* show/hide config preferences

* fix:views and save states

* fix: lint

* fonts

* add fonts

* bump: fairos version to v0.9.0-rc2

* fix: lint

* fix: tests

* Build (#46)

* feat: build and release, #43

* feat: #42, tooltip added for inputs

* fix: #48, settings modal

* Misc.0 (#52)

* feat: #40, display errors in snackbar

* config file name, remember file name, app name change

* add menu placeholders

* about dialog added

* feat: add about information

* feat: enable disable menu items

* feat: handle new pod

* change binary names

Co-authored-by: tfius <[email protected]>
  • Loading branch information
asabya and tfius authored Nov 25, 2022
1 parent e239ecb commit 0916c64
Show file tree
Hide file tree
Showing 61 changed files with 2,918 additions and 1,276 deletions.
67 changes: 16 additions & 51 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
- '**'

jobs:
build:
name: Build
test:
name: Test & Lint
runs-on: ${{ matrix.os }}
env:
GOARCH: ${{ matrix.arch }}
Expand Down Expand Up @@ -41,9 +41,9 @@ jobs:
uses: actions/setup-go@v2
with:
stable: true
go-version: 1.17.*
go-version: 1.18.*

- name: Install winfsp and winfsp-tests (Windows)
- name: Install winfsp (Windows)
if: runner.os == 'Windows'
run: |
$releases = Invoke-WebRequest https://api.github.com/repos/winfsp/winfsp/releases | `
Expand All @@ -52,52 +52,23 @@ jobs:
Where-Object { $_ -match "winfsp-.*\.msi" }
Invoke-WebRequest -Uri $asseturi -Out winfsp.msi
Start-Process -NoNewWindow -Wait msiexec "/i winfsp.msi /qn INSTALLLEVEL=1000"
$asseturi = $releases[0].assets.browser_download_url | `
Where-Object { $_ -match "winfsp-tests-.*\.zip" }
Invoke-WebRequest -Uri $asseturi -Out winfsp-tests.zip
Expand-Archive -Path winfsp-tests.zip
Copy-Item "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" winfsp-tests
shell: powershell

- name: Install FUSE and secfs.test (Linux)
- name: Install FUSE (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -qq install libfuse-dev
sudo apt-get -qq install libacl1-dev
git clone -q https://github.com/billziss-gh/secfs.test.git secfs.test
git -C secfs.test checkout -q edf5eb4a108bfb41073f765aef0cdd32bb3ee1ed
mkdir -p secfs.test/tools/bin
touch secfs.test/tools/bin/bonnie++
touch secfs.test/tools/bin/iozone
make -C secfs.test
# configure fstest for cgofuse
sed -e 's/^fs=.*$/fs="cgofuse"/' -i"" secfs.test/fstest/fstest/tests/conf
# remove irrelevant tests
rm -rf secfs.test/fstest/fstest/tests/xacl
rm -rf secfs.test/fstest/fstest/tests/zzz_ResourceFork
- name: Install FUSE and secfs.test (macOS)
- name: Install FUSE (macOS)
if: runner.os == 'macOS'
run: |
# requires macos-10.15; does not work on macos-latest
# see https://github.com/actions/virtual-environments/issues/4731
brew install macfuse
git clone -q https://github.com/billziss-gh/secfs.test.git secfs.test
git -C secfs.test checkout -q edf5eb4a108bfb41073f765aef0cdd32bb3ee1ed
mkdir -p secfs.test/tools/bin
touch secfs.test/tools/bin/bonnie++
touch secfs.test/tools/bin/iozone
make -C secfs.test
# configure fstest for cgofuse
sed -e 's/^fs=.*$/fs="cgofuse"/' -i "" secfs.test/fstest/fstest/tests/conf
# monkey-patch/disable some tests for macOS
rm secfs.test/fstest/fstest/tests/rmdir/12.t
sed -e 's/lchmod)/lchmod) return 1/' -i "" secfs.test/fstest/fstest/tests/misc.sh
# remove irrelevant tests
rm -rf secfs.test/fstest/fstest/tests/xacl
rm -rf secfs.test/fstest/fstest/tests/zzz_ResourceFork
- name: Set git to use LF
# make sure that line endings are not converted on windows
# as gofmt linter will report that they need to be changed
run: git config --global core.autocrlf false
- name: Cache Go modules
uses: actions/cache@v1
Expand All @@ -108,23 +79,17 @@ jobs:
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
# to avoid no matching files found for go:embed all:frontend/dist in main.go
- run: |
mkdir frontend/dist
touch frontend/dist/index.html
- name: Lint
if: matrix.os == 'ubuntu-latest'
run: make lint
run:
make lint
- name: Test
run: make test
- name: Race
if: matrix.os != 'windows-latest'
run: make test-race
- name: Build
run: make binary
- uses: actions/upload-artifact@v3
if: matrix.os != 'windows-latest'
with:
name: fdfs-${{ matrix.os }}-${{ matrix.arch }}
path: dist/fdfs
- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: fdfs-${{ matrix.os }}-${{ matrix.arch }}.exe
path: dist/fdfs

147 changes: 147 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Release

defaults:
run:
shell: bash

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ${{ matrix.os }}
env:
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: ${{ matrix.cgo }}
CPATH: ${{ matrix.cpath }}
GODEBUG: cgocheck=2
strategy:
matrix:
include:
- os: windows-latest
arch: amd64
cgo: 1
cpath: C:\Program Files (x86)\WinFsp\inc\fuse
- os: ubuntu-latest
arch: amd64
cgo: 1
- os: macos-10.15
arch: amd64
cgo: 1
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install go
uses: actions/setup-go@v2
with:
stable: true
go-version: 1.18.*

- name: Install winfsp (Windows)
if: runner.os == 'Windows'
run: |
$releases = Invoke-WebRequest https://api.github.com/repos/winfsp/winfsp/releases | ConvertFrom-Json
$asseturi = $releases[0].assets.browser_download_url | Where-Object { $_ -match "winfsp-.*\.msi" }
Invoke-WebRequest -Uri $asseturi -Out winfsp.msi
Start-Process -NoNewWindow -Wait msiexec "/i winfsp.msi /qn INSTALLLEVEL=1000"
shell: powershell

- name: Install FUSE (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -qq install libfuse-dev
sudo apt-get -qq install libacl1-dev
sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libwebkit2gtk-4.0-37-gtk2
- name: Install FUSE (macOS)
if: runner.os == 'macOS'
run: |
# requires macos-10.15; does not work on macos-latest
# see https://github.com/actions/virtual-environments/issues/4731
brew install macfuse
- name: Set git to use LF
# make sure that line endings are not converted on windows
# as gofmt linter will report that they need to be changed
run: git config --global core.autocrlf false
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install wails
run: |
GO111MODULE=on go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build
run: make binary
- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: windows
path: build/bin/*
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: linux
path: build/bin/*
- uses: actions/upload-artifact@v3
if: matrix.os == 'macos-10.15'
with:
name: mac
path: build/bin/*
release:
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: windows
path: build/bin/windows
- uses: actions/download-artifact@v3
with:
name: mac
path: build/bin/mac
- uses: actions/download-artifact@v3
with:
name: linux
path: build/bin/linux
- name: Display structure of downloaded files
run: ls -R
- run: mv build/bin/linux/FDA build/bin/fda
- run: mv build/bin/windows/FDA.exe build/bin/fda.exe
- uses: actions/setup-node@v3
with:
node-version: 18
- shell: bash
run: |
chmod +x scripts/add-cert.sh && ./scripts/add-cert.sh
npm install --global create-dmg
chmod +x build/bin/mac/app.app/Contents/MacOS/app
create-dmg build/bin/mac/app.app build/bin --identity '${{ secrets.ID }}'
mv 'build/bin/Fairdrive Desktop App.app' build/bin/fda.dmg
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

- name : Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
.idea/
dist/
dist/
build/bin
node_modules
frontend/dist

frontend/package-lock.json

*/DS_Store
33 changes: 7 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
GO ?= go
GOLANGCI_LINT ?= $$($(GO) env GOPATH)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.30.0
GOLANGCI_LINT_VERSION ?= v1.50.1

COMMIT ?= "$(shell git describe --long --dirty --always --match "" || true)"
VERSION ?= "$(shell git describe --tags --abbrev=0 || true)"
LDFLAGS ?= -s -w -X github.com/datafund/fdfs.commit="$(COMMIT)" -X github.com/datafund/fdfs.version="$(VERSION)"
BUILD_TIMESTAMP ?= "$(shell date '+%B%d,%Y')"
LDFLAGS ?= -s -w -X main.commit="$(COMMIT)" -X main.version="$(VERSION)" -X main.buildTimestamp="$(BUILD_TIMESTAMP)"

.PHONY: lint
lint: linter
$(GOLANGCI_LINT) run
$(GOLANGCI_LINT) run --skip-dirs frontend/dist

.PHONY: linter
linter:
test -f $(GOLANGCI_LINT) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$($(GO) env GOPATH)/bin $(GOLANGCI_LINT_VERSION)

.PHONY: test
test:
$(GO) test -v ./... -timeout 5m
$(GO) test -v ./pkg/fuse -timeout 5m

.PHONY: test-race
test-race:
$(GO) test -v ./... -race -timeout 20m
$(GO) test -v ./pkg/fuse -race -timeout 20m

dist:
mkdir $@
Expand All @@ -34,26 +35,6 @@ clean:
binary: export CGO_ENABLED=1
binary: dist FORCE
$(GO) version
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o dist/fdfs ./cmd
wails build -trimpath -ldflags "$(LDFLAGS)"

FORCE:

.PHONY: snapshot release
snapshot:
docker run --rm --privileged \
-v ~/go/pkg/mod:/go/pkg/mod \
-v `pwd`:/go/src/github.com/datafund/fdfs \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/datafund/fdfs \
ghcr.io/goreleaser/goreleaser-cross:v1.19.1 release --rm-dist \
--skip-validate=true \
--skip-publish

release:
docker run --rm --privileged \
--env-file .release-env \
-v ~/go/pkg/mod:/go/pkg/mod \
-v `pwd`:/go/src/github.com/datafund/fdfs \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/datafund/fdfs \
ghcr.io/goreleaser/goreleaser-cross:v1.19.1 release --rm-dist
Loading

0 comments on commit 0916c64

Please sign in to comment.