diff --git a/.github/RELEASING.md b/.github/RELEASING.md index 4bb1f76..9e04b82 100644 --- a/.github/RELEASING.md +++ b/.github/RELEASING.md @@ -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 `-.`, 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. diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh index d32b122..ad80949 100644 --- a/.github/scripts/release.sh +++ b/.github/scripts/release.sh @@ -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")" @@ -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. diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index accbace..74f3027 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: @@ -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: | @@ -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 @@ -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: @@ -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: