Skip to content

Commit b4e0781

Browse files
[#142] Stable release asset names, automated release publishing, README install block (#143)
* [#142] Stable release asset names, automated release, README install block Installing the tool took more inference than it should, and assembling a release was manual enough to be easy to get wrong. The release zips now have stable names (UnityDataTool-<os>-<arch>.zip), so releases/latest/download/ links are permanent and anything automated can fetch a build without querying the releases API. Pushing a vX.Y.Z tag now builds all three platforms, writes checksums.txt and creates a draft release with them attached, leaving only the title and notes to write by hand. The zips are built in the platform jobs rather than taken from upload-artifact, which drops the executable permission bit on macOS and Linux. The README gains an Install section at the top with per-platform commands that can be copied verbatim, replacing the Downloads section; the agent guide gets the same commands. Documentation/releasing.md describes cutting a release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * [#142] Name the install locations and be honest about upgrades Install into ~/.local/share/UnityDataTool rather than ~/UnityDataTool on macOS and Linux: a visible app folder at the top of the home directory is not a convention, while the XDG data directory is the usual home for a per-user tool on both. Windows keeps %LOCALAPPDATA%\Programs\UnityDataTool, which is where per-user app installs go. The prose now names both paths instead of saying "a directory", and points at the dest variable for installing elsewhere. Re-running the commands overwrites what the new release ships but leaves behind any file the release dropped, so say so and mention deleting the directory first for an exact copy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent ee162e1 commit b4e0781

5 files changed

Lines changed: 199 additions & 11 deletions

File tree

‎.github/workflows/.build.yml‎

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,60 @@ jobs:
7474
cp -R Documentation "$dest/"
7575
shell: bash
7676

77+
# The zip is built here rather than relying on the one upload-artifact produces, because
78+
# that one drops the executable permission bit on macOS and Linux.
79+
- name: Package (Windows)
80+
if: matrix.os == 'windows'
81+
run: |
82+
New-Item -ItemType Directory -Force dist | Out-Null
83+
Compress-Archive -Path "publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}/*" -DestinationPath "dist/UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}.zip"
84+
shell: pwsh
85+
86+
- name: Package (macOS / Linux)
87+
if: matrix.os != 'windows'
88+
run: |
89+
mkdir -p dist
90+
package="$GITHUB_WORKSPACE/dist/UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}.zip"
91+
(cd "publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}" && zip -qr "$package" .)
92+
shell: bash
93+
7794
- name: Upload artifact
7895
uses: actions/upload-artifact@v4
7996
with:
8097
name: UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}-${{ env.environment }}
81-
path: publish/${{ matrix.os }}/${{ matrix.arch }}-${{ env.environment }}
98+
path: dist/UnityDataTool-${{ matrix.os }}-${{ matrix.arch }}.zip
99+
100+
# Pushing a vX.Y.Z tag assembles the release, so the zips always come from a reproducible
101+
# build of the tagged commit and no platform can be left out by hand. The release is left as
102+
# a draft: the remaining step is to write its title and notes, then publish it.
103+
release:
104+
needs: build
105+
if: startsWith(github.ref, 'refs/tags/v')
106+
runs-on: ubuntu-latest
107+
permissions:
108+
contents: write
109+
110+
steps:
111+
- name: Download the platform packages
112+
uses: actions/download-artifact@v4
113+
with:
114+
path: dist
115+
pattern: UnityDataTool-*-release
116+
merge-multiple: true
117+
118+
- name: Generate checksums
119+
run: |
120+
(cd dist && sha256sum *.zip | tee checksums.txt)
121+
shell: bash
122+
123+
- name: Create or update the draft release
124+
env:
125+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126+
TAG: ${{ github.ref_name }}
127+
run: |
128+
if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
129+
gh release upload "$TAG" dist/* --repo "$GITHUB_REPOSITORY" --clobber
130+
else
131+
gh release create "$TAG" dist/* --repo "$GITHUB_REPOSITORY" --draft --generate-notes --title "$TAG"
132+
fi
133+
shell: bash

‎AGENTS.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ dotnet build UnityDataTool/UnityDataTool.csproj -c Release
2525

2626
Output location (Windows): `UnityDataTool\bin\Release\net9.0\UnityDataTool.exe`
2727

28+
Releases are built and published by the "Build UnityDataTool" action when a `vX.Y.Z` tag is pushed;
29+
the process is described in `Documentation/releasing.md`.
30+
2831
### Publishing (Mac-specific)
2932
```bash
3033
# Intel Mac

‎Documentation/agent-guide.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ individual files and objects. This page is the recommended workflow, plus the ha
77
are not obvious from `--help` and tend to cost the most discovery time. It is written so it can be
88
pasted (or linked) into an agent's context, and it is just as useful for humans writing scripts.
99

10+
## Getting the tool
11+
12+
If `UnityDataTool` is not already on the `PATH`, the latest release can be downloaded and unzipped
13+
in one step. The asset name selects the platform: `UnityDataTool-windows-x64.zip`,
14+
`UnityDataTool-macos-arm64.zip`, or `UnityDataTool-linux-x64.zip`.
15+
16+
```bash
17+
dest=~/.local/share/UnityDataTool
18+
curl -fsSL -o /tmp/UnityDataTool.zip https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-linux-x64.zip
19+
unzip -oq /tmp/UnityDataTool.zip -d "$dest" && "$dest/UnityDataTool" --version
20+
```
21+
22+
```powershell
23+
$dest = "$env:LOCALAPPDATA\Programs\UnityDataTool"
24+
Invoke-WebRequest https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-windows-x64.zip -OutFile "$env:TEMP\UnityDataTool.zip"
25+
Expand-Archive "$env:TEMP\UnityDataTool.zip" -DestinationPath $dest -Force
26+
& "$dest\UnityDataTool.exe" --version
27+
```
28+
29+
The zip is self-contained (the executable, the native library it loads, and an offline copy of this
30+
documentation), so a successful `--version` means the tool is ready to use. Re-running the same
31+
commands upgrades an existing install, overwriting what the new release ships without removing files
32+
it has dropped. See the [Install section of the README](../README.md#install) for PATH and macOS
33+
notes.
34+
1035
## The core loop
1136

1237
1. **Analyze the build output into a database.** One build per database (see below).

‎Documentation/releasing.md‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Releasing UnityDataTool
2+
3+
A release is a git tag plus a GitHub release with one zip per platform. The build and the upload are
4+
automated: pushing a `vX.Y.Z` tag runs the "Build UnityDataTool" action, which publishes a **draft**
5+
release with the zips and their checksums attached. What is left is the version bookkeeping around
6+
the tag and writing the release notes.
7+
8+
## The version convention
9+
10+
`UnityDataTool/UnityDataTool.csproj` holds the version. On `main` the `InformationalVersion` always
11+
carries a `-dev` suffix (for example `2.3.0-dev`), which is what `--version` reports and what makes
12+
the documentation link in `--help` point at `main`. A release strips that suffix, so a tagged binary
13+
reports a bare `2.3.0` and links to the docs as they were at the tag.
14+
15+
Immediately after tagging, `main` moves to the *next* `-dev` version. That way work can land on
16+
`main` right after a release without landing on a version number that has already shipped.
17+
18+
## Steps
19+
20+
1. Check that the tests are green on `main`:
21+
<https://github.com/Unity-Technologies/UnityDataTools/actions>.
22+
23+
2. Drop the `-dev` suffix from `InformationalVersion`, commit as `Release vX.Y.Z`, then tag and push
24+
both:
25+
26+
```
27+
git tag vX.Y.Z
28+
git push origin main
29+
git push origin vX.Y.Z
30+
```
31+
32+
3. Bump `main` to the next version: `AssemblyVersion` and `FileVersion` to `X.Y+1.0.0`,
33+
`InformationalVersion` to `X.Y+1.0-dev`. Commit and push.
34+
35+
4. The tag push builds `UnityDataTool-windows-x64.zip`, `UnityDataTool-macos-arm64.zip` and
36+
`UnityDataTool-linux-x64.zip`, writes `checksums.txt`, and creates the draft release. Confirm all
37+
four assets arrived:
38+
39+
```
40+
gh release view vX.Y.Z
41+
```
42+
43+
5. Write the notes and publish. The generated notes list the merged PRs; a short summary of the
44+
user-visible changes on top of them is what most readers actually read.
45+
46+
```
47+
gh release edit vX.Y.Z --title "vX.Y.Z <short description>" --draft=false
48+
```
49+
50+
Steps 2 and 3 are mechanical and worth scripting if you cut releases often.
51+
52+
## Why the asset names have no version in them
53+
54+
`https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-windows-x64.zip`
55+
only works as a permanent download link while the asset names stay the same from release to release.
56+
The README and the agent guide hand those URLs to users, so the names should not be changed or have
57+
the version added back into them. The version is in the release title, in `checksums.txt`, and in
58+
`--version`.
59+
60+
Re-running the action for a tag that already has a release re-uploads the assets over the existing
61+
ones, so a failed or incomplete run can simply be re-run.

‎README.md‎

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,60 @@ The tool also provides comprehensive analysis of **Unity Addressables build repo
1212

1313
The command line tool uses the UnityFileSystemApi library to access the content of Unity Archives and Serialized files, which are Unity's primary binary formats. This repository also serves as a reference for how this library could be used as part of incorporating functionality into your own tools.
1414

15+
## Install
16+
17+
Builds for Windows, macOS (Apple Silicon) and Linux are attached to every
18+
[release](https://github.com/Unity-Technologies/UnityDataTools/releases). They are self-contained:
19+
a zip holds the `UnityDataTool` executable, the native `UnityFileSystemApi` library it uses, and an
20+
offline copy of this README and the `Documentation/` folder. Nothing else needs to be installed, not
21+
even a .NET runtime.
22+
23+
The commands below download the latest release, unzip it, and print the version. They install into
24+
`%LOCALAPPDATA%\Programs\UnityDataTool` on Windows and `~/.local/share/UnityDataTool` on macOS and
25+
Linux; set `dest` to something else to install anywhere you like, such as a shared tools directory.
26+
27+
**Windows** (PowerShell)
28+
29+
```powershell
30+
$dest = "$env:LOCALAPPDATA\Programs\UnityDataTool"
31+
Invoke-WebRequest https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-windows-x64.zip -OutFile "$env:TEMP\UnityDataTool.zip"
32+
Expand-Archive "$env:TEMP\UnityDataTool.zip" -DestinationPath $dest -Force
33+
& "$dest\UnityDataTool.exe" --version
34+
```
35+
36+
**macOS** (Apple Silicon)
37+
38+
```bash
39+
dest=~/.local/share/UnityDataTool
40+
curl -fsSL -o /tmp/UnityDataTool.zip https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-macos-arm64.zip
41+
unzip -oq /tmp/UnityDataTool.zip -d "$dest" && "$dest/UnityDataTool" --version
42+
```
43+
44+
**Linux** (x64)
45+
46+
```bash
47+
dest=~/.local/share/UnityDataTool
48+
curl -fsSL -o /tmp/UnityDataTool.zip https://github.com/Unity-Technologies/UnityDataTools/releases/latest/download/UnityDataTool-linux-x64.zip
49+
unzip -oq /tmp/UnityDataTool.zip -d "$dest" && "$dest/UnityDataTool" --version
50+
```
51+
52+
Add the install directory to your `PATH` to run the tool as `UnityDataTool` from anywhere. The
53+
`releases/latest/download/` links always resolve to the newest release, and `checksums.txt` on the
54+
release page holds the SHA-256 of each zip.
55+
56+
A few things worth knowing:
57+
58+
* To upgrade, run the same commands again. They overwrite everything the new release ships, but they
59+
do not remove a file that it has dropped, so a renamed documentation page can survive as a stale
60+
copy. Delete the install directory first for an install that matches the release exactly.
61+
* On macOS, downloading with `curl` avoids the quarantine flag that a browser download sets. After a
62+
browser download, macOS may refuse to load `UnityFileSystemApi.dylib` until it is allowed under
63+
System Settings > Privacy & Security.
64+
* Intel Macs have no published build; [build from source](#how-to-build) instead.
65+
* Each release describes what changed. For changes that are not in a release yet, see the
66+
[commit history](https://github.com/Unity-Technologies/UnityDataTools/commits/main/) and
67+
[build from source](#how-to-build).
68+
1569
## Documentation
1670

1771
New to Unity's data files or to UnityDataTool? These topics are a good place to start.
@@ -121,16 +175,6 @@ shared test data doubles as convenient sample content for ad hoc use of the tool
121175
* UnityProjects: two Unity projects (`Baseline` and `LeadingEdge`) used to regenerate some of the test
122176
data as Unity evolves.
123177

124-
## Downloads
125-
126-
Prebuilt Windows, Mac, and Linux builds are published on the [Releases page](https://github.com/Unity-Technologies/UnityDataTools/releases). Each release includes a zip per platform containing the `UnityDataTool` executable, the native libraries it needs, and this README plus the matching `Documentation/` folder so the docs are available offline.
127-
128-
To use:
129-
1. Download and unzip the build for your platform.
130-
2. Run UnityDataTool from the extracted location, or add that location to your system PATH.
131-
132-
Each release describes what changed; refer to the [commit history](https://github.com/Unity-Technologies/UnityDataTools/commits/main/) for changes since the latest release. To try unreleased changes, [build from source](#how-to-build).
133-
134178
## Getting UnityFileSystemApi
135179

136180
UnityDataTool uses the pre-compiled `UnityFileSystemApi` library to read Unity Archives and SerializedFiles. **Normally you don't need to do anything with this library.** The repository already includes a recent Windows, Mac, and Linux copy in the [`UnityFileSystem/`](https://github.com/Unity-Technologies/UnityDataTools/tree/main/UnityFileSystem) directory, and using that bundled copy is the recommended way to run the tool.
@@ -154,6 +198,9 @@ On Windows, the executable is written to `UnityDataTool\bin\Release\net9.0`. Add
154198

155199
See the [command-line tool documentation](./Documentation/unitydatatool.md) for usage instructions.
156200

201+
Maintainers: see [Releasing UnityDataTool](./Documentation/releasing.md) for how a release is cut
202+
and published.
203+
157204
## Origins
158205

159206
This tool is the evolution of the [AssetBundle Analyzer](https://github.com/faelenor/asset-bundle-analyzer)

0 commit comments

Comments
 (0)