Skip to content

Fix arm build error

Fix arm build error #8

Workflow file for this run

name: Auto Release with Changelog and Artifacts
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Extract Release Notes
id: changelog
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "Current Tag: $TAG_NAME"
awk "/^## \\[${TAG_NAME}\\]/ {flag=1; next} /^## / {flag=0} flag" CHANGELOG.md > release_notes.md
sed -i "s/^## \\[${TAG_NAME}\\]/## ${TAG_NAME}/" release_notes.md
echo "Release Notes:"
cat release_notes.md
if [ ! -s release_notes.md ]; then
echo "❌ No release notes found for $TAG_NAME"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Verify Git state
run: |
echo "Current branch/tag:"
git branch --show-current || echo "Not on a branch"
git describe --tags || echo "No tags found"
git log -1 --oneline
- name: Build binaries using Makefile
working-directory: ${{ github.workspace }}
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
VERSION=${TAG_NAME}
echo "🔧 Building project for version: ${VERSION}"
mkdir -p release
echo "Building for linux-amd64..."
make build
mv build/dorad release/dorad-${VERSION}-linux-amd
tar -czvf release/dorad-${VERSION}-linux-amd.tar.gz -C release dorad-${VERSION}-linux-amd
echo "Building for linux-arm..."
GOOS=linux GOARCH=arm64 go build -o release/dorad-${VERSION}-linux-arm64 ./cmd/dorad
tar -czvf release/dorad-${VERSION}-linux-arm64.tar.gz -C release dorad-${VERSION}-linux-arm64
echo "Generating SHA256 checksums..."
sha256sum release/* > release/sha256sum.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: ./release_notes.md
files: |
release/dorad-*linux-amd*
release/dorad-*linux-arm*
release/sha256sum.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}