Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aofengli committed Jan 2, 2024
1 parent c0d00d6 commit 09c9d78
Showing 1 changed file with 12 additions and 49 deletions.
61 changes: 12 additions & 49 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,21 @@ on:
- created

jobs:
uploadAssets:
build-go-binary:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux, windows, darwin ] # 需要打包的系统
goarch: [ amd64, arm64 ] # 需要打包的架构
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: build binary by using docker
run: |
sed "s/make build/make build-all-binary/g" Dockerfile | tee Dockerfile.all-binary
docker build -t build:all-binary -f Dockerfile.all-binary --build-arg EVM_CHAIN_ID=6688 .
docker run -itd --name iris-all-binary build:all-binary tail -f /dev/null
mkdir -p build/
- name: tar linux amd64 binary
run: |
docker cp iris-all-binary:/usr/local/bin/iris-linux-amd64 build/
tar -czvf build/iris-linux-amd64-${GITHUB_REF_NAME}.tar.gz build/iris-linux-amd64
- name: tar linux arm64 binary
run: |
docker cp iris-all-binary:/usr/local/bin/iris-linux-arm64 build/
tar -czvf build/iris-linux-arm64-${GITHUB_REF_NAME}.tar.gz build/iris-linux-arm64
- name: get windows amd64 binary
run: |
docker cp iris-all-binary:/usr/local/bin/iris-windows-amd64.exe build/
mv build/iris-windows-amd64.exe build/iris-windows-amd64-${GITHUB_REF_NAME}.exe
ls build/
- name: Upload Linux AMD64 Release Asset
id: upload-linux-amd64
uses: actions/upload-release-asset@v1
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/iris-linux-amd64-${{ github.ref_name }}.tar.gz
asset_name: iris-linux-amd64-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip
- name: Upload Linux ARM64 Release Asset
id: upload-linux-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/iris-linux-arm64-${{ github.ref_name }}.tar.gz
asset_name: iris-linux-arm64-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip
- name: Upload Windows AMD64 Release Asset
id: upload-windows-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/iris-windows-amd64-${{ github.ref_name }}.exe
asset_name: iris-windows-amd64-${{ github.ref_name }}.exe
asset_content_type: application/octet-stream
go-version: '1.19.x'
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
binary_name: "iris"

0 comments on commit 09c9d78

Please sign in to comment.