From a4d2df7f15a48908815194f6b3dde0140dff510a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6gni=20=C3=9E=C3=B3r?= Date: Sat, 28 Mar 2026 12:44:55 +0100 Subject: [PATCH 1/3] Add MIT license and contribution guidelines Co-Authored-By: Claude Opus 4.6 (1M context) --- CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..021b0f4 --- /dev/null +++ b/CONTRIBUTING.md @@ -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//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 and NuGet, 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 `upstream-packages.json` 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. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9419d90 --- /dev/null +++ b/LICENSE @@ -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. From ddb9e785d5842c508a8addca9124ceb7835a97ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6gni=20=C3=9E=C3=B3r?= Date: Sat, 28 Mar 2026 12:51:24 +0100 Subject: [PATCH 2/3] Add release pipeline and build verification step Release pipeline triggers on version tags (v*), cross-compiles for macOS arm64, Linux amd64/arm64, and Windows amd64/arm64, then creates a GitHub release with all binaries. Also adds a build verification step to the CI test pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 3 ++ .github/workflows/release.yml | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 072c18e..da33711 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c78b039 --- /dev/null +++ b/.github/workflows/release.yml @@ -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-* From d42878ae2401243440ce2894583fd435c672ec0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6gni=20=C3=9E=C3=B3r?= Date: Sat, 28 Mar 2026 12:53:58 +0100 Subject: [PATCH 3/3] Address PR review feedback on CONTRIBUTING.md - Mention HTTP archives alongside GitHub and NuGet in integration test description - Use full config path Packages/upstream-packages.json in bug report template Co-Authored-By: Claude Opus 4.6 (1M context) --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 021b0f4..88136e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ go test ./... # unit tests go test -tags=integration -timeout 5m ./... # integration tests (requires network) ``` -Integration tests download real packages from GitHub and NuGet, so they need network access and take longer to run. They're behind the `integration` build tag. +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 @@ -46,7 +46,7 @@ Open an issue with: - What you expected to happen - What actually happened -- Your `upstream-packages.json` config (redact private URLs if needed) +- Your `Packages/upstream-packages.json` config (or the file specified via `-config`; redact private URLs if needed) - Output from running with `-verbose` ## License