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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: Build
run: go build ./...

- name: Verify binary builds
run: go build -o unity-packager .

- name: Unit tests
run: go test ./...

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

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: arm64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: windows
goarch: amd64
- goos: windows
goarch: arm64
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
go build -o unity-packager-${{ matrix.goos }}-${{ matrix.goarch }}${ext} .

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: unity-packager-${{ matrix.goos }}-${{ matrix.goarch }}
path: unity-packager-*

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: unity-packager-*
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing to unity-packager

Thanks for your interest in contributing! Here's how to get started.

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/<your-username>/unity-packager.git`
3. Create a branch: `git checkout -b my-feature`
4. Make your changes
5. Run tests: `go test ./...`
6. Push and open a pull request

## Development

Build and test:

```bash
go build ./... # build
go test ./... # unit tests
go test -tags=integration -timeout 5m ./... # integration tests (requires network)
```

Integration tests download real packages from GitHub, NuGet, and HTTP archives, so they need network access and take longer to run. They're behind the `integration` build tag.

## Pull Requests

- Keep PRs focused on a single change
- Include tests for new functionality
- Make sure `go test ./...` passes before submitting
- Update documentation if you're adding or changing config options

## Adding a New Package Type

If you want to add a new package source type:

1. Add the type constant to `internal/config/config.go` and update `Validate()`
2. Create a handler in `internal/packager/` (see `git.go` or `nuget.go` for examples)
3. Wire it into `processPackage()` in `internal/packager/packager.go`
4. Add cache support in `internal/packager/cache.go` if the source is downloadable
5. Add unit tests and an integration test

## Reporting Bugs

Open an issue with:

- What you expected to happen
- What actually happened
- Your `Packages/upstream-packages.json` config (or the file specified via `-config`; redact private URLs if needed)
- Output from running with `-verbose`

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Hogni Thor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading