diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a94754e..d2cea3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,9 +32,30 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} + - name: Download and extract SDK + shell: bash + # If "XENSERVER_SDK_URL" is setup in the repository variable, will use it + # as SDK URL, otherwise, will extract the SDK version from https://www.xenserver.com/downloads. + # and download the SDK from https://github.com/xapi-project/xen-api/releases accordingly. + # it will help to ignore the "Download Agreement" from the official XenServer SDK download page. + run: | + url=${{ vars.XENSERVER_SDK_URL }} + if [ -z "$url" ]; then + version=$(curl -s 'https://www.xenserver.com/downloads' | \ + grep -oE 'Software Development Kit \(SDK\) [0-9]+\.[0-9]+\.[0-9]+' | \ + grep -oE '[0-9]+\.[0-9]+\.[0-9]+$') + url="https://github.com/xapi-project/xen-api/releases/download/v${version}/Go-SDK-prerelease-unsigned.zip" + fi + curl -L "$url" -o xenserver-sdk.zip + unzip xenserver-sdk.zip -d sdk_temp + mkdir -p goSDK + mv sdk_temp/sdk_go/src/* goSDK/ + rm -rf sdk_temp xenserver-sdk.zip - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: + distribution: goreleaser + version: "~> v2" args: release --clean env: # GitHub sets the GITHUB_TOKEN secret automatically. diff --git a/.goreleaser.yml b/.goreleaser.yml index 9bb0aa7..a23bd3d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 # Visit https://goreleaser.com for documentation on how to customize this # behavior. before: @@ -41,7 +42,7 @@ checksum: signs: - artifacts: checksum args: - # if you are using this in a GitHub action or some other automated pipeline, you + # if you are using this in a GitHub action or some other automated pipeline, you # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" @@ -56,5 +57,3 @@ release: name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' # If you want to manually examine the release before its live, uncomment this line: # draft: true -changelog: - skip: true