mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 08:53:46 +00:00
ci: refact ci and package
* use self-hosted github ci runner * migrate artifacts source from oss to s3
This commit is contained in:
parent
6e77392c65
commit
2d96d1d796
2 changed files with 23 additions and 33 deletions
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
|
|
@ -12,7 +12,7 @@ defaults:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
|
|
@ -34,3 +34,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: v1.42.1
|
version: v1.42.1
|
||||||
only-new-issues: true
|
only-new-issues: true
|
||||||
|
skip-pkg-cache: true
|
||||||
|
skip-build-cache: true:w
|
||||||
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
|
|
@ -13,14 +13,14 @@ env:
|
||||||
TEMP_ARTIFACT_NAME: geth
|
TEMP_ARTIFACT_NAME: geth
|
||||||
BUILT_BINARY_PATH: build/bin
|
BUILT_BINARY_PATH: build/bin
|
||||||
BUILT_BINARY_NAME: geth
|
BUILT_BINARY_NAME: geth
|
||||||
OSS_ARCHIVE_FILE_NAME: eth-latest-linux-amd64
|
ARCHIVE_FILE_NAME: eth-latest-linux-amd64
|
||||||
OSS_ARCHIVE_BUCKET: debank-artifacts
|
ARCHIVE_BUCKET: debank-build-artifacts
|
||||||
OSS_ARCHIVE_FILE_PREFIX: downloads
|
ARCHIVE_FILE_PREFIX: downloads
|
||||||
OSS_DOMESTIC_ENDPOINT: oss-cn-hangzhou.aliyuncs.com
|
AWS_REGION: ap-northeast-1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
|
|
@ -32,19 +32,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/go/pkg/mod
|
|
||||||
~/.cache/go-build
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Make binaries
|
- name: Make binaries
|
||||||
run: |
|
run: |
|
||||||
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
||||||
make geth
|
make
|
||||||
|
|
||||||
- name: Archive built binaries
|
- name: Archive built binaries
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|
@ -54,7 +45,7 @@ jobs:
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
package:
|
package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Download built binaries
|
- name: Download built binaries
|
||||||
|
|
@ -65,30 +56,27 @@ jobs:
|
||||||
|
|
||||||
- name: Archive artifacts
|
- name: Archive artifacts
|
||||||
run: |
|
run: |
|
||||||
mkdir $OSS_ARCHIVE_FILE_NAME
|
mkdir $ARCHIVE_FILE_NAME
|
||||||
cp $BUILT_BINARY_PATH/$BUILT_BINARY_NAME $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
cp $BUILT_BINARY_PATH/$BUILT_BINARY_NAME $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
||||||
sha256sum $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME --tag >> $OSS_ARCHIVE_FILE_NAME/sha256.checksum
|
sha256sum $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME --tag >> $ARCHIVE_FILE_NAME/sha256.checksum
|
||||||
chmod u+x $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
chmod u+x $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
||||||
$OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME version
|
$ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME version
|
||||||
tar cvfz $OSS_ARCHIVE_FILE_NAME.tar.gz $OSS_ARCHIVE_FILE_NAME
|
tar cvfz $ARCHIVE_FILE_NAME.tar.gz $ARCHIVE_FILE_NAME
|
||||||
|
|
||||||
- name: Setup aliyun oss
|
- name: Configure AWS Credentials
|
||||||
uses: barryz/setup-ossutil@master
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ env.OSS_DOMESTIC_ENDPOINT }}
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
access-key-id: ${{ secrets.OSS_KEY_ID }}
|
|
||||||
access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
|
|
||||||
|
|
||||||
- name: Copy artifacts to oss
|
- name: Copy artifacts to s3
|
||||||
run: |
|
run: |
|
||||||
ossutil cp -rf $OSS_ARCHIVE_FILE_NAME.tar.gz oss://$OSS_ARCHIVE_BUCKET/$OSS_ARCHIVE_FILE_PREFIX/$OSS_ARCHIVE_FILE_NAME.tar.gz
|
aws s3 cp $ARCHIVE_FILE_NAME.tar.gz s3://$ARCHIVE_BUCKET/$ARCHIVE_FILE_PREFIX/$ARCHIVE_FILE_NAME.tar.gz --acl public-read
|
||||||
ossutil set-acl oss://$OSS_ARCHIVE_BUCKET/$OSS_ARCHIVE_FILE_PREFIX/$OSS_ARCHIVE_FILE_NAME.tar.gz public-read
|
|
||||||
|
|
||||||
- name: comment PR
|
- name: comment PR
|
||||||
uses: unsplash/comment-on-pr@master
|
uses: unsplash/comment-on-pr@master
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
msg: "Artifacts uploaded, click or copy [this link](https://${{ env.OSS_ARCHIVE_BUCKET }}.${{ env.OSS_DOMESTIC_ENDPOINT }}/${{ env.OSS_ARCHIVE_FILE_PREFIX }}/${{ env.OSS_ARCHIVE_FILE_NAME }}.tar.gz) to download. :tada:"
|
msg: "Artifacts uploaded, click or copy [this link](https://${{ env.ARCHIVE_BUCKET }}.s3.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ARCHIVE_FILE_PREFIX }}/${{ env.ARCHIVE_FILE_NAME }}.tar.gz) to download. :tada:"
|
||||||
check_for_duplicate_msg: true
|
check_for_duplicate_msg: true
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
Loading…
Reference in a new issue