From 1e0b3cc574c14e66af2500f16ab8d933b82ae544 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 7 Jan 2026 14:40:30 +0000 Subject: [PATCH] Update Go Publishing step --- .gitea/workflows/release.yaml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index b11bb74..9fb8cfe 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -78,10 +78,27 @@ jobs: - name: Publish Go 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 - go mod init git.fjla.uk/owlboard/backend-data-contracts + go mod init $MOD_NAME 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 }}" \ - --upload-file ../../rail-backend-${{ steps.get_version.outputs.VERSION }}.zip \ - ${{ github.server_url }}/api/packages/owlboard/go/upload + --upload-file module.zip \ + "${{ github.server_url }}/api/packages/owlboard/go/upload?version=$VERSION" \ No newline at end of file