Fix structure of internal ZIP file for the Go release
All checks were successful
Generate and Release Protos / release (push) Successful in 25s

This commit is contained in:
2026-01-08 22:47:30 +00:00
parent a78e749d55
commit 3199037c5a

View File

@@ -73,27 +73,22 @@ jobs:
- name: Publish Go
run: |
# 1. Setup variables
VERSION="v${{ steps.get_version.outputs.VERSION }}"
MOD_NAME="git.fjla.uk/owlboard/backend-data-contracts"
# Create a temporary directory structure that matches Go proxy requirements
DEST_DIR="temp_zip/$MOD_NAME@$VERSION"
# 2. Generate go.mod and tidy
ZIP_ROOT="/tmp/go_upload"
FULL_PATH="$ZIP_ROOT/$MOD_NAME@$VERSION"
cd gen/go
go mod init $MOD_NAME
go mod tidy
# 3. Move files into the required nested structure
mkdir -p "../../$DEST_DIR"
cp -r . "../../$DEST_DIR/"
# 4. Zip from the temp root so the internal paths are correct
cd ../../temp_zip
zip -r ../module.zip .
# 5. Upload with the explicit version
cd ..
curl -f -v --user "owlbot:${{ secrets.PACKAGE_PUSH }}" \
--upload-file module.zip \
mkdir -p "$FULL_PATH"
cp -r . "$FULL_PATH/"
pushd "$ZIP_ROOT"
zip -r "$GITHUB_WORKSPACE/module.zip" .
popd
curl -f --user "owlbot:${{ secrets.PACKAGE_PUSH }}" \
--upload-file "$GITHUB_WORKSPACE/module.zip" \
"${{ github.server_url }}/api/packages/owlboard/go/upload?version=$VERSION"