Skip to content

Commit

Permalink
[feat] add workflow to attach build artifacts (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBoWu authored and leeren committed Oct 14, 2024
1 parent 03e05c9 commit d43dbee
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Release Binaries

on:
release:
types:
- created

permissions:
id-token: write
contents: write
pull-requests: write
actions: write

jobs:
Timestamp:
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main

build:
needs: Timestamp
name: Build Release Assets
runs-on: ubuntu-latest
strategy:
matrix:
platform:
[linux-amd64, linux-arm64, darwin-amd64, darwin-arm64]

steps:
- name: Checkout code
uses: actions/checkout@v4.1.5

- name: Display Go version
run: go version

- name: Display the release tag
run: |
echo "Release tag: ${{ github.event.release.tag_name }}"
- name: Set up environment for cross-compilation
run: |
IFS="-" read -r GOOS GOARCH <<< "${{ matrix.platform }}"
output_name=./build/bin/geth-${{ matrix.platform }}
echo "Building for $GOOS/$GOARCH..."
env GOOS=$GOOS GOARCH=$GOARCH go build -o $output_name ./cmd/geth
- name: Upload binaries and source code to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
file: |
./build/bin/geth-${{ matrix.platform }}
file_glob: false
2 changes: 1 addition & 1 deletion .github/workflows/ci-ecr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload geth Binary
name: Build and Upload geth Binary to ECR

on:
workflow_dispatch:
Expand Down

0 comments on commit d43dbee

Please sign in to comment.