diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index c944b7a..42ce7db 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -1,7 +1,7 @@ name: Linux Build on: - workflow_dispatch: # Only enable manual runs for now + workflow_dispatch: # Enable manual execution jobs: build: @@ -36,11 +36,9 @@ jobs: - name: List Build Directory run: ls -R bin - # Archive the build artifacts - - name: Archive Build Artifacts + # Upload Build Artifact + - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: gogg-linux-amd64 path: 'bin/gogg' - - diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_macos.yml similarity index 87% rename from .github/workflows/build_mac.yml rename to .github/workflows/build_macos.yml index 27e65c1..fb23f61 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_macos.yml @@ -1,7 +1,7 @@ name: MacOS Build on: - workflow_dispatch: # Only enable manual runs for now + workflow_dispatch: # Enable manual execution jobs: build: @@ -30,17 +30,15 @@ jobs: - name: Build for MacOS run: | make build-macos - continue-on-error: false # Debug: List Build Directory - name: List Build Directory run: ls -R bin - # Archive the build artifacts - - name: Archive Build Artifacts + # Upload Build Artifact + - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: gogg-macos-universal path: 'bin/gogg' - diff --git a/.github/workflows/build_win.yml b/.github/workflows/build_windows.yml similarity index 88% rename from .github/workflows/build_win.yml rename to .github/workflows/build_windows.yml index 9836bf9..4731b9c 100644 --- a/.github/workflows/build_win.yml +++ b/.github/workflows/build_windows.yml @@ -1,7 +1,7 @@ name: Windows Build on: - workflow_dispatch: # Only enable manual runs for now + workflow_dispatch: # Enable manual execution jobs: build: @@ -36,11 +36,9 @@ jobs: - name: List Build Directory run: ls -R bin - # Archive the build artifacts - - name: Archive Build Artifacts + # Upload Build Artifact + - name: Upload Build Artifact uses: actions/upload-artifact@v4 with: name: gogg-windows-amd64 path: 'bin/gogg.exe' - - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4959351 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,137 @@ +name: Build and Release + +on: + workflow_dispatch: # Allow manual execution + push: + tags: + - 'v*' # Trigger on version tags + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23 + + - name: Install Dependencies + run: | + choco install make -y + make format + make test + + - name: Build Windows Binary + run: | + make build GOGG_BINARY=gogg.exe + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v4 + with: + name: gogg-windows + path: bin/gogg.exe + + build-linux: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y make + make format + make test + + - name: Build Linux Binary + run: | + make build + + - name: Upload Linux Artifact + uses: actions/upload-artifact@v4 + with: + name: gogg-linux + path: bin/gogg + + build-macos: + runs-on: macos-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23 + + - name: Install Dependencies + run: | + brew install make + make format + make test + + - name: Build macOS Binary + run: | + make build-macos + + - name: Upload macOS Artifact + uses: actions/upload-artifact@v4 + with: + name: gogg-macos + path: bin/gogg + + release: + runs-on: ubuntu-latest + needs: [ build-windows, build-linux, build-macos ] + steps: + - name: Download Windows Artifact + uses: actions/download-artifact@v4 + with: + name: gogg-windows + path: ./windows + + - name: Download Linux Artifact + uses: actions/download-artifact@v4 + with: + name: gogg-linux + path: ./linux + + - name: Download macOS Artifact + uses: actions/download-artifact@v4 + with: + name: gogg-macos + path: ./macos + + - name: List Downloaded Files (for debugging) + run: ls -R . + + - name: Rename Extracted Binaries + run: | + cd windows && zip -r9 ../gogg-windows-amd64.zip gogg.exe && cd .. + cd linux && zip -r9 ../gogg-linux-amd64.zip gogg && cd .. + cd macos && zip -r9 ../gogg-macos-universal.zip gogg && cd .. + + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ github.ref_name }} + tag: ${{ github.ref_name }} + body: | + Release version ${{ github.ref_name }} + - Binary builds for Windows, Linux, and macOS + artifacts: | + gogg-windows-amd64.zip + gogg-linux-amd64.zip + gogg-macos-universal.zip + draft: false + prerelease: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a8b2427 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to Gogg + +Thank you for considering contributing to Gogg. +Contributions are always welcome and appreciated. + +## How to Contribute + +### Reporting Bugs + +1. Open an issue on the [issue tracker](https://github.com/habedi/gogg/issues). +2. Include information like steps to reproduce, expected/actual behaviour, and relevant logs or screenshots. + +### Suggesting Features + +1. Open an issue on the [issue tracker](https://github.com/habedi/gogg/issues). +2. Write a little about the feature, its purpose, and potential implementation ideas. + +## Submitting Pull Requests + +- Make sure all tests pass before submitting a pull request. +- Write a clear description of the changes you made and why you made them for the pull request. + +## Code Style + +- Use the `make format` command to format the code. + +## Running Tests + +- Use the `make test` command to run the unit tests. + +## Miscellaneous + +- Run `make help` to see all available commands to manage different tasks. diff --git a/Makefile b/Makefile index e05d51a..3b0e7f6 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ help: @echo " snap-deps Install Snapcraft dependencies" @echo " snap Build the Snap package" @echo " install-deps Install development dependencies on Debian-based systems" + @echo " lint Lint Go files to check for potential errors" @echo " help Show this help message" # Building the project @@ -75,6 +76,7 @@ snap-deps: @echo "Installing Snapcraft dependencies..." sudo apt-get update sudo apt-get install -y snapd + sudo snap refresh sudo snap install snapcraft --classic sudo snap install multipass --classic @@ -86,7 +88,13 @@ snap: build # snap-deps # Install Dependencies on Debian-based systems like Ubuntu install-deps: @echo "Installing dependencies..." - sudo apt-get update - sudo apt-get install -y chromium-browser snapd build-essential - sudo snap refresh - sudo snap install snapcraft multipass chromium go + make snap-deps + sudo apt-get install -y chromium-browser build-essential + sudo snap install chromium + sudo snap install go --classic + sudo snap install golangci-lint --classic + +# Linting Go files +lint: + @echo "Linting Go files..." + golangci-lint run ./... diff --git a/README.md b/README.md index 361e361..be14882 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
- - - Gogg logo + + + Gogg logo

@@ -20,10 +20,16 @@ Release - - Snap Store +
+
+ Linux Build + + + Windows Build + + + MacOS Build -

# Gogg @@ -56,6 +62,8 @@ Additionally, it allows users to perform the following actions: See the [documentation](docs/README.md) for how to install and use Gogg. +Run `gogg -h` to see the available commands and options. + ### Examples For more detailed examples, see the content of the [examples](docs/examples/) directory. @@ -76,8 +84,8 @@ gogg auth ``` > You must have [Google Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/) installed -on your machine for the first-time authentication. -So, make sure you have one of them installed. +> on your machine for the first-time authentication. +> So, make sure you have one of them installed. #### Syncing the Game Catalogue @@ -93,6 +101,6 @@ gogg catalogue refresh gogg download --id 1207658924 --dir ./games --platform windows --lang en --dlcs true --extras true --resume true --threads 5 ``` -## Bugs and Features +## Contributing -Use the [issue tracker](github.com/habedi/gogg/issues) to report a bug or ask for a feature. +Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for information on how to contribute to Gogg. diff --git a/assets/workflow.dot b/assets/workflow.dot deleted file mode 100644 index e69de29..0000000 diff --git a/cmd/version.go b/cmd/version.go index 6ef3aaf..8599137 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -6,7 +6,7 @@ import ( var ( // Gogg version - version = "0.2.0" + version = "0.2.1" ) // versionCmd shows the version of Gogg diff --git a/docs/README.md b/docs/README.md index 3c5025c..56756f5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,11 +10,8 @@ You can download the binary builds of Gogg for your operating system from the [releases page](https://github.com/habedi/gogg/releases). - You might want to add the binary to your system's PATH to use it from anywhere on your system. -Run `gogg -h` to see the available commands and options. - ## Usage ### First Time Setup diff --git a/assets/logo-v1.jpeg b/logo.jpeg similarity index 100% rename from assets/logo-v1.jpeg rename to logo.jpeg diff --git a/main.go b/main.go index b23448d..696f820 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ func main() { signal.Notify(stopChan, os.Interrupt) go listenForInterrupt(stopChan) - // Execute the CLI program + // Program entry point cmd.Execute() }