Skip to content

Commit

Permalink
update pre-release/release workflow config
Browse files Browse the repository at this point in the history
  • Loading branch information
eric0x01 committed Jul 29, 2022
1 parent e96b18c commit 6219caa
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 255 deletions.
11 changes: 1 addition & 10 deletions .github/generate_change_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,21 @@ while read line; do
CHANGE_LOG+="$line\n"
fi
done < ${change_log_file}
MAINNET_ZIP_SUM="$(checksum ./mainnet.zip)"
#MAINNET_ZIP_SUM="$(checksum ./mainnet.zip)"
TESTNET_ZIP_SUM="$(checksum ./testnet.zip)"
LINUX_BIN_SUM="$(checksum ./linux/geth)"
MAC_BIN_SUM="$(checksum ./macos/geth)"
WINDOWS_BIN_SUM="$(checksum ./windows/geth.exe)"
ARM5_BIN_SUM="$(checksum ./arm5/geth-linux-arm-5)"
ARM6_BIN_SUM="$(checksum ./arm6/geth-linux-arm-6)"
ARM7_BIN_SUM="$(checksum ./arm7/geth-linux-arm-7)"
ARM64_BIN_SUM="$(checksum ./arm64/geth-linux-arm64)"
OUTPUT=$(cat <<-END
## Changelog\n
${CHANGE_LOG}\n
## Assets\n
| Assets | Sha256 Checksum |\n
| :-----------: |------------|\n
| mainnet.zip | ${MAINNET_ZIP_SUM} |\n
| testnet.zip | ${TESTNET_ZIP_SUM} |\n
| geth_linux | ${LINUX_BIN_SUM} |\n
| geth_mac | ${MAC_BIN_SUM} |\n
| geth_windows | ${WINDOWS_BIN_SUM} |\n
| geth_linux_arm5 | ${ARM5_BIN_SUM} |\n
| geth_linux_arm6 | ${ARM6_BIN_SUM} |\n
| geth_linux_arm7 | ${ARM7_BIN_SUM} |\n
| geth_linux_arm64 | ${ARM64_BIN_SUM} |\n
END
)

Expand Down
4 changes: 2 additions & 2 deletions .github/release.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MAINNET_FILE_URL="https://github.com/binance-chain/bsc/releases/download/v1.1.7/mainnet.zip"
TESTNET_FILE_URL="https://github.com/binance-chain/bsc/releases/download/v1.1.7/testnet.zip"
MAINNET_FILE_URL="https://github.com/coredao-org/core-chain/releases/latest/download/mainnet.zip"
TESTNET_FILE_URL="https://github.com/coredao-org/core-chain/releases/latest/download/testnet.zip"
139 changes: 18 additions & 121 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'pre-*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: Build Release
Expand Down Expand Up @@ -45,19 +48,6 @@ jobs:
- 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
# ==============================
Expand All @@ -75,42 +65,14 @@ jobs:
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
Expand All @@ -131,55 +93,30 @@ jobs:
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
# curl -L $MAINNET_FILE_URL -o ./mainnet.zip

# ==============================
# Create release
# ==============================

- name: Create Release
id: create_release
uses: actions/create-release@latest
Expand All @@ -206,7 +143,7 @@ jobs:
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:
Expand All @@ -216,7 +153,7 @@ jobs:
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:
Expand All @@ -227,56 +164,16 @@ jobs:
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 - 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 - 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:
Expand Down
Loading

0 comments on commit 6219caa

Please sign in to comment.