mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
🎉 fix release ci (#23)
This commit is contained in:
parent
793530de6f
commit
b48059b86c
2 changed files with 80 additions and 36 deletions
71
.github/workflows/build.yml
vendored
Normal file
71
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
name: "Build new artifacts"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'debank'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILT_BINARY_PATH: build/bin
|
||||||
|
BUILT_BINARY_NAME: geth
|
||||||
|
ARCHIVE_FILE_NAME: eth-latest-linux-amd64
|
||||||
|
ARCHIVE_BUCKET: debank-build-artifacts
|
||||||
|
ARCHIVE_FILE_PREFIX: downloads/ethereum
|
||||||
|
AWS_REGION: ap-northeast-1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-artifacts:
|
||||||
|
runs-on: [self-hosted, general]
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.17.x
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- uses: tibdex/github-app-token@v1
|
||||||
|
id: generate-token
|
||||||
|
with:
|
||||||
|
app_id: ${{ secrets.RELEASE_MANAGER_APP_ID }}
|
||||||
|
private_key: ${{ secrets.RELEASE_MANAGER_APP_SECRET }}
|
||||||
|
|
||||||
|
- name: Make binaries
|
||||||
|
run: |
|
||||||
|
git config --global url."https://${{ steps.generate-token.outputs.token }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
||||||
|
make
|
||||||
|
|
||||||
|
- name: Set env
|
||||||
|
run: |
|
||||||
|
echo "ARCHIVE_FILE_NAME=eth-$(git rev-parse --short HEAD)-linux-amd64" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Archive artifacts
|
||||||
|
run: |
|
||||||
|
mkdir $ARCHIVE_FILE_NAME
|
||||||
|
cp $BUILT_BINARY_PATH/$BUILT_BINARY_NAME $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
||||||
|
sha256sum $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME --tag >> $ARCHIVE_FILE_NAME/sha256.checksum
|
||||||
|
chmod u+x $ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
||||||
|
$ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME version
|
||||||
|
tar cvfz $ARCHIVE_FILE_NAME.tar.gz $ARCHIVE_FILE_NAME
|
||||||
|
|
||||||
|
- name: Configure AWS Credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
|
||||||
|
- name: Copy artifacts to s3
|
||||||
|
run: |
|
||||||
|
aws s3 cp $ARCHIVE_FILE_NAME.tar.gz s3://$ARCHIVE_BUCKET/$ARCHIVE_FILE_PREFIX/$ARCHIVE_FILE_NAME.tar.gz --acl public-read
|
||||||
|
|
||||||
|
- name: comment PR
|
||||||
|
uses: unsplash/comment-on-pr@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
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
|
||||||
|
continue-on-error: true
|
||||||
43
.github/workflows/release.yml
vendored
43
.github/workflows/release.yml
vendored
|
|
@ -1,25 +1,20 @@
|
||||||
name: "Release new artifacts"
|
name: "Release new artifacts"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches:
|
types:
|
||||||
- 'debank'
|
- created
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'debank'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TEMP_ARTIFACT_NAME: geth
|
|
||||||
BUILT_BINARY_PATH: build/bin
|
BUILT_BINARY_PATH: build/bin
|
||||||
BUILT_BINARY_NAME: geth
|
BUILT_BINARY_NAME: geth
|
||||||
ARCHIVE_FILE_NAME: eth-latest-linux-amd64
|
|
||||||
ARCHIVE_BUCKET: debank-build-artifacts
|
ARCHIVE_BUCKET: debank-build-artifacts
|
||||||
ARCHIVE_FILE_PREFIX: downloads
|
ARCHIVE_FILE_PREFIX: downloads/ethereum
|
||||||
AWS_REGION: ap-northeast-1
|
AWS_REGION: ap-northeast-1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release-artifacts:
|
||||||
runs-on: [self-hosted, general]
|
runs-on: [self-hosted, general]
|
||||||
steps:
|
steps:
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
|
|
@ -43,22 +38,9 @@ jobs:
|
||||||
git config --global url."https://${{ steps.generate-token.outputs.token }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
git config --global url."https://${{ steps.generate-token.outputs.token }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
||||||
make
|
make
|
||||||
|
|
||||||
- name: Archive built binaries
|
- name: Set env
|
||||||
uses: actions/upload-artifact@v2
|
run: |
|
||||||
with:
|
echo "ARCHIVE_FILE_NAME=eth-${GITHUB_REF#refs/*/}-linux-amd64" >> $GITHUB_ENV
|
||||||
name: ${{ env.TEMP_ARTIFACT_NAME }}
|
|
||||||
path: ${{ env.BUILT_BINARY_PATH }}/${{ env.BUILT_BINARY_NAME }}
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
package:
|
|
||||||
runs-on: [self-hosted, general]
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Download built binaries
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: ${{ env.TEMP_ARTIFACT_NAME }}
|
|
||||||
path: ${{ env.BUILT_BINARY_PATH }}
|
|
||||||
|
|
||||||
- name: Archive artifacts
|
- name: Archive artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -77,12 +59,3 @@ jobs:
|
||||||
- name: Copy artifacts to s3
|
- name: Copy artifacts to s3
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp $ARCHIVE_FILE_NAME.tar.gz s3://$ARCHIVE_BUCKET/$ARCHIVE_FILE_PREFIX/$ARCHIVE_FILE_NAME.tar.gz --acl public-read
|
aws s3 cp $ARCHIVE_FILE_NAME.tar.gz s3://$ARCHIVE_BUCKET/$ARCHIVE_FILE_PREFIX/$ARCHIVE_FILE_NAME.tar.gz --acl public-read
|
||||||
|
|
||||||
- name: comment PR
|
|
||||||
uses: unsplash/comment-on-pr@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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
|
|
||||||
continue-on-error: true
|
|
||||||
Loading…
Reference in a new issue