chore: update workflows
This commit is contained in:
@@ -11,28 +11,12 @@ jobs:
|
|||||||
name: Publish to Go Module Proxy
|
name: Publish to Go Module Proxy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Request module from proxy
|
- name: Set up Go
|
||||||
run: |
|
uses: actions/setup-go@v6
|
||||||
MODULE="github.com/StevanFreeborn/onspring-api-sdk-go"
|
with:
|
||||||
VERSION="${{ inputs.version }}"
|
go-version: "1.25"
|
||||||
PROXY_URL="https://proxy.golang.org/${MODULE}/@v/${VERSION}.info"
|
cache: false
|
||||||
|
- name: Publish module to proxy
|
||||||
echo "Requesting: $PROXY_URL"
|
env:
|
||||||
|
GOPROXY: proxy.golang.org
|
||||||
# Request the module version to warm the proxy cache
|
run: go list -m github.com/StevanFreeborn/onspring-api-sdk-go@${{ inputs.version }}
|
||||||
# Retry up to 3 times with a delay since the proxy may need time to fetch
|
|
||||||
for i in 1 2 3; do
|
|
||||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$PROXY_URL")
|
|
||||||
echo "Attempt $i: HTTP $STATUS"
|
|
||||||
|
|
||||||
if [ "$STATUS" = "200" ]; then
|
|
||||||
echo "Module $MODULE@$VERSION is available on the Go module proxy"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Waiting 30 seconds before retry..."
|
|
||||||
sleep 30
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Warning: Module may not be immediately available on the proxy (HTTP $STATUS)"
|
|
||||||
echo "It will be indexed automatically when first requested by a user"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user