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