From 09c9d780179c96cd017b959ca694a2afe88717ae Mon Sep 17 00:00:00 2001 From: aofengli Date: Tue, 2 Jan 2024 17:38:27 +0800 Subject: [PATCH] update workflow --- .github/workflows/release-binary.yml | 61 ++++++---------------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 56e6fba21..84b1666cf 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -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 \ No newline at end of file + go-version: '1.19.x' + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + binary_name: "iris" \ No newline at end of file