mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
ci: add github action to replace import_path and release (#847)
This commit is contained in:
parent
0144095e64
commit
ec6915d9b6
1 changed files with 45 additions and 0 deletions
45
.github/workflows/release-sdk.yaml
vendored
Normal file
45
.github/workflows/release-sdk.yaml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
name: Release SDK
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
REV:
|
||||||
|
description: "revision. can be commit hash or tag"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-sdk:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout revision
|
||||||
|
run: |
|
||||||
|
git checkout ${{ github.event.inputs.REV }}
|
||||||
|
- name: Replace import path
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Define the old and new import paths
|
||||||
|
OLD_IMPORT_PATH="github.com/ethereum/go-ethereum"
|
||||||
|
NEW_IMPORT_PATH="github.com/scroll-tech/go-ethereum"
|
||||||
|
|
||||||
|
# List of file types to search through
|
||||||
|
FILE_TYPES=("*.go" "go.mod" "*.txt")
|
||||||
|
|
||||||
|
# Loop through each file type and replace the import path
|
||||||
|
for FILE_TYPE in "${FILE_TYPES[@]}"; do
|
||||||
|
find . -type f -name "$FILE_TYPE" -exec sed -i "s|$OLD_IMPORT_PATH|$NEW_IMPORT_PATH|g" {} +
|
||||||
|
done
|
||||||
|
- name: Commit the changes and push
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
|
||||||
|
with:
|
||||||
|
skip_fetch: true
|
||||||
|
file_pattern: "*"
|
||||||
|
commit_message: "chore: replace import path [bot]"
|
||||||
|
create_branch: true
|
||||||
|
branch: ${{ github.event.inputs.REV }}-replace-import-path
|
||||||
|
tagging_message: sdk-${{ github.event.inputs.REV }}
|
||||||
Loading…
Reference in a new issue