Update Go Publishing step
All checks were successful
Generate and Release Protos / release (push) Successful in 22s

This commit is contained in:
2026-01-07 14:40:30 +00:00
parent cf2609f624
commit 1e0b3cc574

View File

@@ -78,10 +78,27 @@ jobs:
- name: Publish Go - name: Publish Go
run: | run: |
# 1. Setup variables
VERSION="${{ 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
cd gen/go cd gen/go
go mod init git.fjla.uk/owlboard/backend-data-contracts go mod init $MOD_NAME
go mod tidy go mod tidy
zip -r ../../rail-backend-${{ steps.get_version.outputs.VERSION }}.zip .
# 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 }}" \ curl -f -v --user "owlbot:${{ secrets.PACKAGE_PUSH }}" \
--upload-file ../../rail-backend-${{ steps.get_version.outputs.VERSION }}.zip \ --upload-file module.zip \
${{ github.server_url }}/api/packages/owlboard/go/upload "${{ github.server_url }}/api/packages/owlboard/go/upload?version=$VERSION"