Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc92331238 | |||
| a4e6386fd1 |
@@ -78,17 +78,24 @@ jobs:
|
||||
ZIP_ROOT="/tmp/go_upload"
|
||||
FULL_PATH="$ZIP_ROOT/$MOD_NAME@$VERSION"
|
||||
|
||||
# 1. Prepare
|
||||
cd gen/go
|
||||
go mod init $MOD_NAME
|
||||
go mod tidy
|
||||
|
||||
|
||||
# 2. Initialize the module
|
||||
go mod init "$MOD_NAME"
|
||||
|
||||
# 3. Create the structure
|
||||
mkdir -p "$FULL_PATH"
|
||||
cp -r . "$FULL_PATH/"
|
||||
|
||||
pushd "$ZIP_ROOT"
|
||||
zip -r "$GITHUB_WORKSPACE/module.zip" .
|
||||
popd
|
||||
|
||||
|
||||
# 4. Copy the CONTENTS of models to the root of the module
|
||||
# This flattens the structure so the .go files are next to go.mod
|
||||
cp -r models/* "$FULL_PATH/"
|
||||
cp go.mod "$FULL_PATH/"
|
||||
|
||||
# 5. Zip and Upload
|
||||
cd "$ZIP_ROOT"
|
||||
zip -r -D "$GITHUB_WORKSPACE/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