| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- name: Release
- on:
- push:
- # Publish `v1.2.3` tags as releases.
- tags:
- - v*
- jobs:
- build:
- name: Build Release
- strategy:
- matrix:
- go-version: [1.16.x]
- os: [ubuntu-18.04, macos-11, windows-2019]
- runs-on: ${{ matrix.os }}
- steps:
- - name: Checkout Code
- uses: actions/checkout@v2
- - name: Install Go
- uses: actions/setup-go@v2
- with:
- go-version: ${{ matrix.go-version }}
- - uses: actions/cache@v2
- with:
- # In order:
- # * Module download cache
- # * Build cache (Linux)
- # * Build cache (Mac)
- # * Build cache (Windows)
- path: |
- ~/go/pkg/mod
- ~/.cache/go-build
- ~/Library/Caches/go-build
- %LocalAppData%\go-build
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- restore-keys: |
- ${{ runner.os }}-go-
- # ==============================
- # Linux/Macos/Windows Build
- # ==============================
- - name: Build Binary for ${{matrix.os}}
- run: make geth
- # ==============================
- # Cross Compile for ARM
- # ==============================
- - name: Build Binary for ARM
- if: matrix.os == 'ubuntu-18.04'
- env:
- GOPATH: /home/runner/work/woodpecker/go
- run: |
- mkdir -p $GOPATH/src/github.com/binance-chain/bsc/
- cp -r ./* $GOPATH/src/github.com/binance-chain/bsc/
- cd $GOPATH/src/github.com/binance-chain/bsc/ && make geth-linux-arm
- # ==============================
- # Upload artifacts
- # ==============================
- - name: Upload Linux Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'ubuntu-18.04'
- with:
- name: linux
- path: ./build/bin/geth
- - name: Upload MacOS Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'macos-11'
- with:
- name: macos
- path: ./build/bin/geth
-
- - name: Upload Windows Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'windows-2019'
- with:
- name: windows
- path: ./build/bin/geth.exe
- - name: Upload ARM-5 Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'ubuntu-18.04'
- with:
- name: arm5
- path: /home/runner/work/woodpecker/go/src/github.com/binance-chain/bsc/build/bin/geth-linux-arm-5
-
- - name: Upload ARM-6 Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'ubuntu-18.04'
- with:
- name: arm6
- path: /home/runner/work/woodpecker/go/src/github.com/binance-chain/bsc/build/bin/geth-linux-arm-6
- - name: Upload ARM-7 Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'ubuntu-18.04'
- with:
- name: arm7
- path: /home/runner/work/woodpecker/go/src/github.com/binance-chain/bsc/build/bin/geth-linux-arm-7
- - name: Upload ARM-64 Build
- uses: actions/upload-artifact@v2
- if: matrix.os == 'ubuntu-18.04'
- with:
- name: arm64
- path: /home/runner/work/woodpecker/go/src/github.com/binance-chain/bsc/build/bin/geth-linux-arm64
- release:
- name: Release
- needs: build
- runs-on: ubuntu-18.04
- steps:
- - name: Set Env
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- - name: Checkout Code
- uses: actions/checkout@v2
- # ==============================
- # Download artifacts
- # ==============================
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: linux
- path: ./linux
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: macos
- path: ./macos
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: windows
- path: ./windows
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: arm5
- path: ./arm5
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: arm6
- path: ./arm6
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: arm7
- path: ./arm7
-
- - name: Download Artifacts
- uses: actions/download-artifact@v2
- with:
- name: arm64
- path: ./arm64
-
- - name: Download Config File
- run: |
- . ./.github/release.env
- echo "mainnet.zip url: $MAINNET_FILE_URL"
- echo "testnet.zip url: $TESTNET_FILE_URL"
- curl -L $MAINNET_FILE_URL -o ./mainnet.zip
- curl -L $TESTNET_FILE_URL -o ./testnet.zip
- # ==============================
- # Create release
- # ==============================
- - name: Generate Change Log
- id: changelog
- run: |
- chmod 755 ./.github/generate_change_log.sh
- CHANGELOG=$(./.github/generate_change_log.sh ${{ env.RELEASE_VERSION}})
- echo "CHANGELOG<<EOF" >> $GITHUB_ENV
- echo "$CHANGELOG" >> $GITHUB_ENV
- echo "EOF" >> $GITHUB_ENV
- - name: Create Release
- id: create_release
- uses: actions/create-release@latest
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- with:
- tag_name: ${{ github.ref }}
- release_name: ${{ github.ref }}
- body: |
- ${{ env.CHANGELOG }}
- draft: false
- prerelease: false
- # Check downloaded files
- - run: ls
- - name: Upload Release Asset - Linux
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./linux/geth
- asset_name: geth_linux
- asset_content_type: application/octet-stream
-
- - name: Upload Release Asset - MacOS
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./macos/geth
- asset_name: geth_mac
- asset_content_type: application/octet-stream
-
- - name: Upload Release Asset - Windows
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./windows/geth.exe
- asset_name: geth_windows.exe
- asset_content_type: application/octet-stream
-
- - name: Upload Release Asset - Linux ARM 5
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./arm5/geth-linux-arm-5
- asset_name: geth-linux-arm-5
- asset_content_type: application/octet-stream
-
- - name: Upload Release Asset - Linux ARM 6
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./arm6/geth-linux-arm-6
- asset_name: geth-linux-arm-6
- asset_content_type: application/octet-stream
- - name: Upload Release Asset - Linux ARM 7
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./arm7/geth-linux-arm-7
- asset_name: geth-linux-arm-7
- asset_content_type: application/octet-stream
- - name: Upload Release Asset - Linux ARM 64
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./arm64/geth-linux-arm64
- asset_name: geth-linux-arm64
- asset_content_type: application/octet-stream
-
- - name: Upload Release Asset - MAINNET.ZIP
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./mainnet.zip
- asset_name: mainnet.zip
- asset_content_type: application/zip
-
- - name: Upload Release Asset - TESTNET.ZIP
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./testnet.zip
- asset_name: testnet.zip
- asset_content_type: application/zip
|