mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-06-29 05:42:37 +00:00
feat: use GoReleaser Pro for split/merge CGO builds
- Add goreleaser-key input for Pro license - Use goreleaser-pro distribution for split/merge modes - Split: goreleaser release --clean --split - Merge: goreleaser continue --merge - Pass GORELEASER_PRO secret to action 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,10 @@ inputs:
|
|||||||
github-token:
|
github-token:
|
||||||
description: "GitHub token"
|
description: "GitHub token"
|
||||||
required: true
|
required: true
|
||||||
|
goreleaser-key:
|
||||||
|
description: "GoReleaser Pro license key (for split/merge)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
homebrew-tap-token:
|
homebrew-tap-token:
|
||||||
description: "Homebrew tap token (optional)"
|
description: "Homebrew tap token (optional)"
|
||||||
required: false
|
required: false
|
||||||
@@ -46,47 +50,25 @@ runs:
|
|||||||
HOMEBREW_TAP_TOKEN: ${{ inputs.homebrew-tap-token }}
|
HOMEBREW_TAP_TOKEN: ${{ inputs.homebrew-tap-token }}
|
||||||
CGO_ENABLED: ${{ inputs.cgo-enabled }}
|
CGO_ENABLED: ${{ inputs.cgo-enabled }}
|
||||||
|
|
||||||
- name: Run GoReleaser (build + archive for CGO matrix)
|
- name: Run GoReleaser Pro (split)
|
||||||
if: inputs.mode == 'split'
|
if: inputs.mode == 'split'
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser-pro
|
||||||
version: "~> v2"
|
version: "~> v2"
|
||||||
args: release --clean --skip=publish --single-target
|
args: release --clean --split
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ inputs.github-token }}
|
GITHUB_TOKEN: ${{ inputs.github-token }}
|
||||||
|
GORELEASER_KEY: ${{ inputs.goreleaser-key }}
|
||||||
CGO_ENABLED: ${{ inputs.cgo-enabled }}
|
CGO_ENABLED: ${{ inputs.cgo-enabled }}
|
||||||
GORELEASER_CURRENT_TAG: ${{ inputs.version-tag }}
|
|
||||||
|
|
||||||
- name: Create GitHub Release and upload artifacts
|
- name: Run GoReleaser Pro (merge)
|
||||||
if: inputs.mode == 'merge'
|
if: inputs.mode == 'merge'
|
||||||
shell: bash
|
uses: goreleaser/goreleaser-action@v6
|
||||||
|
with:
|
||||||
|
distribution: goreleaser-pro
|
||||||
|
version: "~> v2"
|
||||||
|
args: continue --merge
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ inputs.github-token }}
|
GITHUB_TOKEN: ${{ inputs.github-token }}
|
||||||
VERSION_TAG: ${{ inputs.version-tag }}
|
GORELEASER_KEY: ${{ inputs.goreleaser-key }}
|
||||||
run: |
|
|
||||||
# List downloaded artifacts
|
|
||||||
echo "=== Downloaded artifacts ==="
|
|
||||||
find dist -type f | head -50
|
|
||||||
|
|
||||||
# Create release if it doesn't exist
|
|
||||||
gh release view "$VERSION_TAG" >/dev/null 2>&1 || \
|
|
||||||
gh release create "$VERSION_TAG" \
|
|
||||||
--title "Release $VERSION_TAG" \
|
|
||||||
--generate-notes
|
|
||||||
|
|
||||||
# Upload all archive files
|
|
||||||
for archive in dist/*.tar.gz dist/*.zip; do
|
|
||||||
if [[ -f "$archive" ]]; then
|
|
||||||
echo "Uploading: $archive"
|
|
||||||
gh release upload "$VERSION_TAG" "$archive" --clobber
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Upload checksums if present
|
|
||||||
for checksum in dist/checksums*.txt; do
|
|
||||||
if [[ -f "$checksum" ]]; then
|
|
||||||
echo "Uploading: $checksum"
|
|
||||||
gh release upload "$VERSION_TAG" "$checksum" --clobber
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|||||||
@@ -160,6 +160,7 @@ jobs:
|
|||||||
mode: split
|
mode: split
|
||||||
cgo-enabled: "1"
|
cgo-enabled: "1"
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
goreleaser-key: ${{ secrets.GORELEASER_PRO }}
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -199,6 +200,7 @@ jobs:
|
|||||||
version-tag: ${{ needs.version.outputs.version_tag }}
|
version-tag: ${{ needs.version.outputs.version_tag }}
|
||||||
mode: merge
|
mode: merge
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
goreleaser-key: ${{ secrets.GORELEASER_PRO }}
|
||||||
|
|
||||||
- name: Rolling release
|
- name: Rolling release
|
||||||
if: inputs.rolling-release-tag != ''
|
if: inputs.rolling-release-tag != ''
|
||||||
|
|||||||
Reference in New Issue
Block a user