Skip to content
Merged
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
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,31 @@ jobs:
working-directory: frontend
run: npm ci && npm run build

# Wails v3 Linux defaults to gtk4/webkitgtk6; this project targets the
# gtk3/webkit2gtk 4.1 stack (EXTRA_TAGS=gtk3) for broader distro support.
- name: Install webview deps
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev

- name: golangci-lint
# built from source with the runner's Go so its language version
# always matches go.mod (prebuilt binaries lag behind)
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run ./...
golangci-lint run --build-tags gtk3 ./...

- name: gofmt check
run: test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; }
run: |
files=$(find . -name '*.go' \
-not -path './frontend/node_modules/*' \
-not -path './e2e/node_modules/*' \
-not -path './bin/*')
test -z "$(gofmt -l $files)" || { gofmt -l $files; exit 1; }

- name: go vet
run: go vet ./...
run: go vet -tags gtk3 ./...

- name: go test
run: go test -timeout 300s ./...
run: go test -tags gtk3 -timeout 300s ./...

frontend:
name: Frontend — format, lint, typecheck, build
Expand Down Expand Up @@ -95,8 +105,8 @@ jobs:
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.13.0
- name: Install Wails v3 CLI
run: go install -tags gtk3 github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha2.119

- name: Install webview and display deps
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev xvfb
Expand Down
41 changes: 31 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,26 @@ jobs:
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.13.0
- name: Install Wails v3 CLI
# gtk3 tag: CLI itself links webkit; needed on Linux runners without gtk4
run: go install -tags gtk3 github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha2.119

- name: Install Linux webview deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev imagemagick

- name: Build
run: wails build -platform ${{ matrix.platform }} -tags webkit2_41 -o ${{ matrix.bin }}
# Wails v3 builds for the host OS via Taskfile; matrix runners are
# native (ubuntu → linux, macos → darwin, windows → windows).
# Linux uses EXTRA_TAGS=gtk3 (webkit2gtk 4.1) so CI doesn't need gtk4.
- name: Build (Linux)
if: runner.os == 'Linux'
run: wails3 build -tags gtk3
env:
EXTRA_TAGS: gtk3

- name: Build (macOS / Windows)
if: runner.os != 'Linux'
run: wails3 build

# ---------- Linux: AppImage ----------

Expand All @@ -66,7 +77,8 @@ jobs:
if: runner.os == 'Linux'
run: |
mkdir -p AppDir/usr/bin
cp build/bin/croc-desktop AppDir/usr/bin/
# v3 places host builds in bin/ (Taskfile BIN_DIR)
cp bin/croc-desktop AppDir/usr/bin/
# linuxdeploy only accepts standard icon resolutions (max 512px)
# and deploys the icon by basename, which must match Icon=croc-desktop
convert build/appicon.png -resize 512x512 /tmp/croc-desktop.png
Expand All @@ -84,11 +96,20 @@ jobs:
- name: Ad-hoc sign and package DMG
if: runner.os == 'macOS'
run: |
cd build/bin
codesign --deep --force --sign - croc-desktop.app
mkdir -p dmg
cp -R croc-desktop.app dmg/
hdiutil create -volname croc -srcfolder dmg -ov -format UDZO ../../${{ matrix.artifact }}
# wails3 package lays out a .app under bin/; fall back to a bare binary
APP_PATH="bin/croc-desktop.app"
if [ ! -d "$APP_PATH" ]; then
wails3 package
fi
if [ -d "$APP_PATH" ]; then
codesign --deep --force --sign - "$APP_PATH"
mkdir -p dmg
cp -R "$APP_PATH" dmg/
else
mkdir -p dmg
cp bin/croc-desktop dmg/
fi
hdiutil create -volname croc -srcfolder dmg -ov -format UDZO ${{ matrix.artifact }}

# ---------- Windows: MSI ----------

Expand Down
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Binaries / build output
bin/
build/bin/
/croc-gui
/croc-desktop

# Task (taskfile.dev) cache
.task/

# Test binary, built with `go test -c`
*.test
Expand All @@ -9,5 +14,16 @@ build/bin/
frontend/node_modules/
frontend/dist/

# Wails generated bindings
# Wails v2 generated bindings (legacy)
frontend/wailsjs/

# Wails v3 binding generation temps
frontend/.bindings-tmp-*/

# Mobile build outputs (generated by wails3 task ios:* / android:*)
build/ios/xcode/
bin/*.a
bin/*.app
*.apk
*.aab
*.ipa
134 changes: 134 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement by opening a
confidential report via GitHub Security Advisories on this repository, or by
contacting the maintainers through a private GitHub message.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
Loading
Loading