Fix structure of internal ZIP file for the Go release
All checks were successful
Generate and Release Protos / release (push) Successful in 25s
All checks were successful
Generate and Release Protos / release (push) Successful in 25s
This commit is contained in:
@@ -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"
|
||||
ZIP_ROOT="/tmp/go_upload"
|
||||
FULL_PATH="$ZIP_ROOT/$MOD_NAME@$VERSION"
|
||||
|
||||
# 2. Generate go.mod and tidy
|
||||
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/"
|
||||
mkdir -p "$FULL_PATH"
|
||||
cp -r . "$FULL_PATH/"
|
||||
|
||||
# 4. Zip from the temp root so the internal paths are correct
|
||||
cd ../../temp_zip
|
||||
zip -r ../module.zip .
|
||||
pushd "$ZIP_ROOT"
|
||||
zip -r "$GITHUB_WORKSPACE/module.zip" .
|
||||
popd
|
||||
|
||||
# 5. Upload with the explicit version
|
||||
cd ..
|
||||
curl -f -v --user "owlbot:${{ secrets.PACKAGE_PUSH }}" \
|
||||
--upload-file module.zip \
|
||||
curl -f --user "owlbot:${{ secrets.PACKAGE_PUSH }}" \
|
||||
--upload-file "$GITHUB_WORKSPACE/module.zip" \
|
||||
"${{ github.server_url }}/api/packages/owlboard/go/upload?version=$VERSION"
|
||||
Reference in New Issue
Block a user