diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index a0f885e..4bc1bb8 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -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" \ No newline at end of file