chore(ci): release workflow patches (#15)

* chore(ci): release workflow patches

* Reelase fixes
This commit is contained in:
Cal Bera 2025-06-23 12:22:54 -07:00 committed by GitHub
parent 61c4c97cba
commit d80965096e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 99 deletions

View file

@ -4,7 +4,6 @@ on:
push:
branches:
- "main"
- "fix-ci" # TODO: remove fix-ci after testing.
tags:
- "v1.*"
@ -47,23 +46,10 @@ jobs:
- name: Upload artifacts (amd64)
uses: actions/upload-artifact@v4
with:
name: linux-amd64-archives
path: "*.tar.gz*"
- name: Cleanup bin
run: rm -f build/bin/*
- name: Build (386)
run: |
go run build/ci.go install -arch 386 -dlgo
- name: Create archive (386)
run: |
go run build/ci.go archive -arch 386 -type tar
- name: Upload artifacts (386)
uses: actions/upload-artifact@v4
with:
name: linux-386-archives
path: "*.tar.gz*"
name: geth-linux-amd64-archives
path: |
geth-linux-amd64-*.tar.gz
geth-alltools-linux-amd64-*.tar.gz
- name: Cleanup bin
run: rm -f build/bin/*
@ -96,64 +82,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: linux-arm64-archives
path: "*arm64*.tar.gz*"
- name: Cleanup bin
run: rm -fr build/bin/*
- name: Run build (arm5)
run: |
go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc
env:
GOARM: "5"
- name: Create archive (arm5)
run: |
go run build/ci.go archive -arch arm -type tar
env:
GOARM: "5"
- name: Upload artifacts (arm5)
uses: actions/upload-artifact@v4
with:
name: linux-arm5-archives
path: "*arm*5*.tar.gz*"
- name: Cleanup bin
run: rm -fr build/bin/*
- name: Run build (arm6)
run: |
go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc
env:
GOARM: "6"
- name: Create archive (arm6)
run: |
go run build/ci.go archive -arch arm -type tar
env:
GOARM: "6"
- name: Upload artifacts (arm6)
uses: actions/upload-artifact@v4
with:
name: linux-arm6-archives
path: "*arm*6*.tar.gz*"
- name: Cleanup bin
run: rm -fr build/bin/*
- name: Run build (arm7)
run: |
go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc
env:
GOARM: "7"
- name: Create archive (arm7)
run: |
go run build/ci.go archive -arch arm -type tar
env:
GOARM: "7"
- name: Upload artifacts (arm7)
uses: actions/upload-artifact@v4
with:
name: linux-arm7-archives
path: "*arm*7*.tar.gz*"
path: |
geth-linux-arm64-*.tar.gz
geth-alltools-linux-arm64-*.tar.gz
- name: Cleanup bin
run: rm -fr build/bin/*
@ -191,7 +122,7 @@ jobs:
run: |
go run build/ci.go dockerx -platform linux/amd64,linux/arm64 -hub ghcr.io/berachain/bera-geth -upload
release:
draft-release:
name: Draft Release
needs: [extract-version, linux-intel, linux-arm]
runs-on: ubuntu-latest
@ -222,9 +153,25 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Move all artifacts to current directory
find ./artifacts -name "*.tar.gz*" -exec mv {} . \;
find ./artifacts -name "*.tar.gz" -exec mv {} . \;
body=$(cat <<- "ENDBODY"
# List available files for debugging
echo "Available files:"
ls -la *.tar.gz || echo "No tar.gz files found"
# Get actual archive names
GETH_AMD64=$(ls geth-linux-amd64-*.tar.gz | grep -v alltools | head -1)
GETH_ARM64=$(ls geth-linux-arm64-*.tar.gz | grep -v alltools | head -1)
GETH_ALLTOOLS_AMD64=$(ls geth-alltools-linux-amd64-*.tar.gz | head -1)
GETH_ALLTOOLS_ARM64=$(ls geth-alltools-linux-arm64-*.tar.gz | head -1)
echo "Found archives:"
echo " AMD64: $GETH_AMD64"
echo " ARM64: $GETH_ARM64"
echo " Alltools AMD64: $GETH_ALLTOOLS_AMD64"
echo " Alltools ARM64: $GETH_ALLTOOLS_ARM64"
body=$(cat <<- 'ENDBODY'
![bera-geth](https://raw.githubusercontent.com/berachain/bera-geth/main/.github/meta/bera-geth.png)
## Summary
@ -252,24 +199,20 @@ jobs:
| System | Architecture | Binary | Notes |
|:---:|:---:|:---:|:---|
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | amd64 | [geth-linux-amd64-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-amd64-${{ env.VERSION }}.tar.gz) | Most Linux systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | 386 | [geth-linux-386-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-386-${{ env.VERSION }}.tar.gz) | Older Linux systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | arm64 | [geth-linux-arm64-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-arm64-${{ env.VERSION }}.tar.gz) | 64-bit ARM systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | armv5 | [geth-linux-arm-5-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-arm-5-${{ env.VERSION }}.tar.gz) | ARMv5 systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | armv6 | [geth-linux-arm-6-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-arm-6-${{ env.VERSION }}.tar.gz) | ARMv6 systems (Raspberry Pi Zero) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | armv7 | [geth-linux-arm-7-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-linux-arm-7-${{ env.VERSION }}.tar.gz) | ARMv7 systems (Raspberry Pi 2+) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | - | [geth-alltools-linux-amd64-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-alltools-linux-amd64-${{ env.VERSION }}.tar.gz) | All tools bundle (amd64) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | - | [geth-alltools-linux-arm64-${{ env.VERSION }}.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/geth-alltools-linux-arm64-${{ env.VERSION }}.tar.gz) | All tools bundle (arm64) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | amd64 | [GETH_AMD64_PLACEHOLDER](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/GETH_AMD64_PLACEHOLDER) | Most Linux systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | arm64 | [GETH_ARM64_PLACEHOLDER](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/GETH_ARM64_PLACEHOLDER) | 64-bit ARM systems |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | - | [GETH_ALLTOOLS_AMD64_PLACEHOLDER](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/GETH_ALLTOOLS_AMD64_PLACEHOLDER) | All tools bundle (amd64) |
| <img src="https://simpleicons.org/icons/linux.svg" style="width: 32px;"/> | - | [GETH_ALLTOOLS_ARM64_PLACEHOLDER](https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/GETH_ALLTOOLS_ARM64_PLACEHOLDER) | All tools bundle (arm64) |
| **System** | **Option** | - | **Resource** |
| <img src="https://simpleicons.org/icons/docker.svg" style="width: 32px;"/> | Docker | | [ghcr.io/berachain/bera-geth](https://ghcr.io/berachain/bera-geth) |
### Installation
The archives contain the geth binary and license file. Extract and run:
\`\`\`bash
tar -xzf geth-linux-amd64-${{ env.VERSION }}.tar.gz
```bash
tar -xzf GETH_AMD64_PLACEHOLDER
./geth
\`\`\`
```
The **alltools** archives additionally contain:
- `abigen` - Source code generator for Ethereum contracts
@ -280,5 +223,19 @@ jobs:
ENDBODY
)
# Replace placeholders with actual filenames
body="${body//GETH_AMD64_PLACEHOLDER/$GETH_AMD64}"
body="${body//GETH_ARM64_PLACEHOLDER/$GETH_ARM64}"
body="${body//GETH_ALLTOOLS_AMD64_PLACEHOLDER/$GETH_ALLTOOLS_AMD64}"
body="${body//GETH_ALLTOOLS_ARM64_PLACEHOLDER/$GETH_ALLTOOLS_ARM64}"
# Create assets array for gh release
assets=()
for asset in geth-*.tar.gz; do
if [ -f "$asset" ]; then
assets+=("$asset")
fi
done
tag_name="${{ env.VERSION }}"
echo "$body" | gh release create --draft -t "Geth $tag_name" -F "-" "$tag_name" *.tar.gz
echo "$body" | gh release create --draft -t "Bera Geth $tag_name" -F "-" "$tag_name" "${assets[@]}"

View file

@ -572,9 +572,9 @@ func doArchive(cmdline []string) {
var (
env = build.Env()
basegeth = archiveBasename(*arch, version.Archive(env.Commit))
geth = "geth-" + basegeth + ext
alltools = "geth-alltools-" + basegeth + ext
basegeth = archiveBasename(*arch, version.Archive(env.Tag, env.Commit))
geth = "bera-geth-" + basegeth + ext
alltools = "bera-geth-alltools-" + basegeth + ext
)
maybeSkipArchive(env)
if err := build.WriteArchive(geth, gethArchiveFiles); err != nil {
@ -650,8 +650,7 @@ func maybeSkipArchive(env build.Environment) {
log.Printf("skipping archive creation because this is a PR build")
os.Exit(0)
}
// TODO: remove fix-ci after testing.
if env.Branch != "main" && env.Branch != "fix-ci" && !strings.HasPrefix(env.Tag, "v1.") {
if env.Branch != "main" && !strings.HasPrefix(env.Tag, "v1.") {
log.Printf("skipping archive creation because branch %q, tag %q is not on the inclusion list", env.Branch, env.Tag)
os.Exit(0)
}
@ -1094,7 +1093,7 @@ func doWindowsInstaller(cmdline []string) {
if env.Commit != "" {
ver[2] += "-" + env.Commit[:8]
}
installer, err := filepath.Abs("geth-" + archiveBasename(*arch, version.Archive(env.Commit)) + ".exe")
installer, err := filepath.Abs("geth-" + archiveBasename(*arch, version.Archive(env.Tag, env.Commit)) + ".exe")
if err != nil {
log.Fatalf("Failed to convert installer file path: %v", err)
}

View file

@ -57,8 +57,8 @@ func WithCommit(gitCommit, gitDate string) string {
// Archive holds the textual version string used for Geth archives. e.g.
// "1.8.11-dea1ce05" for stable releases, or "1.8.13-unstable-21c059b6" for unstable
// releases.
func Archive(gitCommit string) string {
vsn := Semantic
func Archive(tag, gitCommit string) string {
vsn := tag
if version.Meta != "stable" {
vsn += "-" + version.Meta
}