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
5 changes: 5 additions & 0 deletions .github/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ Existing published versions remain unchanged. See [OpenUPM's signing workflow](h
3. The **Release / publish-openupm** job requests publication through GitHub OIDC
and checks that OpenUPM reports the version as signed. No OpenUPM token is needed.

Both release assets use `<package.json name>-<version>.<extension>`, for example:

- `com.mackysoft.serializereference-extensions-2.0.1.unitypackage`
- `com.mackysoft.serializereference-extensions-2.0.1.tgz`

Keep the signed `.tgz` attached to the public Release so OpenUPM can retrieve it.
5 changes: 3 additions & 2 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [[ "$operation" == prepare ]]; then
fi

source_sha="$(git rev-parse HEAD)"
package_name="$(jq -er '.name' "$TARGET_FILE")"
current_version="$(jq -er '.version | select(type == "string" and length > 0)' "$TARGET_FILE")"
if [[ "$current_version" != "$VERSION" ]]; then
manifest="$(mktemp "$RUNNER_TEMP/release-package-XXXXXX")"
Expand Down Expand Up @@ -58,8 +59,8 @@ if [[ "$operation" == prepare ]]; then
git push --no-follow-tags --recurse-submodules=no \
--force-with-lease="$RELEASE_REF:$source_sha" origin "$RELEASE_SHA:$RELEASE_REF"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "sha=$RELEASE_SHA" >> "$GITHUB_OUTPUT"
printf 'version=%s\nsha=%s\nasset_basename=%s-%s\n' \
"$VERSION" "$RELEASE_SHA" "$package_name" "$VERSION" >> "$GITHUB_OUTPUT"
elif [[ -z "$tag_commit" ]]; then
git tag -- "$VERSION" "$RELEASE_SHA"
# A non-forced tag push rejects a concurrent release for a different commit.
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
outputs:
sha: ${{ steps.metadata.outputs.sha }}
version: ${{ steps.metadata.outputs.version }}
asset_basename: ${{ steps.metadata.outputs.asset_basename }}
steps:
- name: Check signing credentials
env:
Expand Down Expand Up @@ -148,12 +149,16 @@ jobs:
tar -czf Build/StandaloneLinux64.tar.gz -C Build StandaloneLinux64

- name: Export unitypackage
env:
RELEASE_ASSET_BASENAME: ${{ needs.prepare.outputs.asset_basename }}
run: |
unity --non-interactive run . \
--editor-version 2021.3.45f2 \
--log-file Logs/package.log \
--timeout 900 \
-- -nographics -executeMethod MackySoft.PackageTools.Editor.UnityPackageExporter.Export
mv -- Build/SerializeReference-Extensions.unitypackage \
"Build/$RELEASE_ASSET_BASENAME.unitypackage"

- name: check all .meta is commited
run: |
Expand Down Expand Up @@ -184,8 +189,8 @@ jobs:

- uses: actions/upload-artifact@v7
with:
name: SerializeReference-Extensions.unitypackage
path: ./Build/SerializeReference-Extensions.unitypackage
name: ${{ needs.prepare.outputs.asset_basename }}.unitypackage
path: ./Build/${{ needs.prepare.outputs.asset_basename }}.unitypackage
if-no-files-found: error

- name: Upload Unity logs
Expand Down Expand Up @@ -224,8 +229,8 @@ jobs:
# Download the package artifact for the release.
- uses: actions/download-artifact@v8
with:
name: SerializeReference-Extensions.unitypackage
path: SerializeReference-Extensions.unitypackage
name: ${{ needs.prepare.outputs.asset_basename }}.unitypackage
path: UnityPackage

- uses: actions/download-artifact@v8
with:
Expand All @@ -244,7 +249,7 @@ jobs:
prerelease: false
fail_on_unmatched_files: true
files: |
SerializeReference-Extensions.unitypackage/SerializeReference-Extensions.unitypackage
UnityPackage/${{ needs.prepare.outputs.asset_basename }}.unitypackage
Signed-UPM/*.tgz

publish-openupm:
Expand Down