diff --git a/.github/actions/commit-changes/action.yml b/.github/actions/commit-changes/action.yml deleted file mode 100644 index f572b32..0000000 --- a/.github/actions/commit-changes/action.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: 'Commit and push if the version file has changed' - -inputs: - name: - description: 'The name of the commiter' - required: true - default: 'github-actions[bot]' - email: - description: 'The email of the commiter' - required: true - default: 'github-actions[bot]@users.noreply.github.com' - message: - description: 'The commit message' - required: true - default: 'New release version(s)' - files: - description: 'The file(s) to add in the commit' - required: true - default: '*' - directory: - description: 'The directory in which the action will be performed' - required: true - default: '.' - src_branch: - description: 'Checkout (or create) a specific branch before commit/push. Defaults to current branch' - required: false - default: '' - dst_branch: - description: 'Push the created commit on a specific branch. Defaults to current branch' - required: false - default: '' - secret: - description: 'A token allowing to push the commit on the repository' - required: true - default: '.' - repository: - description: 'The repository where to push' - required: true - default: '' - -runs: - using: 'composite' - steps: - - name: Commit the changes - id: commit - run: | - git config --global user.name ${{ inputs.name }} - ORIGIN="$(pwd)" - cd ${{ inputs.directory }} - - CURRENT_BRANCH=${GITHUB_REF#refs/heads/}; - # calculating source branch - if [ -n "${{ inputs.src_branch }}" ]; \ - then \ - git switch ${{ inputs.src_branch }} 2>/dev/null || git switch -c ${{ inputs.src_branch }}; \ - SRC_BRANCH=${{ inputs.src_branch }}; \ - else \ - SRC_BRANCH=`git branch --show-current`; \ - if [ -z "$SRC_BRANCH" ]; \ - then \ - SRC_BRANCH=$CURRENT_BRANCH; \ - fi \ - fi - - # calculating destination branch - if [ -n "${{ inputs.dst_branch }}" ]; \ - then \ - DST_BRANCH=${{ inputs.dst_branch }}; \ - else \ - DST_BRANCH=`git branch --show-current`; \ - if [ -z "$DST_BRANCH" ]; \ - then \ - DST_BRANCH=$CURRENT_BRANCH; \ - fi \ - fi - - echo "-----------------------------------------------------------" - echo "Initial repo status" - git status - # checking changes, commit if needed - CHANGES="$(git status --porcelain ${{ inputs.files }})" - if [ -n "${CHANGES}" ]; \ - then \ - echo -e "Changes:\n${CHANGES}"; \ - git add ${{ inputs.files }}; \ - echo "-----------------------------------------------------------"; \ - echo "Repo status before commit"; \ - git status; \ - git commit -am "${{ inputs.message }}"; \ - fi - - # compute if a push is needed - if [ -n "${CHANGES}" -o "$SRC_BRANCH" != "$DST_BRANCH" ]; \ - then \ - PUSH="YES"; \ - else \ - PUSH="NO"; \ - fi - - git log -n 2 - cd "${ORIGIN}" - - echo " -- Env SRC_BRANCH: $SRC_BRANCH"; - echo " -- Env DST_BRANCH: $DST_BRANCH"; - echo " -- Env PUSH: $PUSH" - # exporting these variables for next steps - echo "##[set-output name=src_branch;]$(echo $SRC_BRANCH)"; - echo "##[set-output name=dst_branch;]$(echo $DST_BRANCH)"; - echo "##[set-output name=push;]$(echo $PUSH)"; - shell: bash - - - name: Push commit - if: steps.commit.outputs.push == 'YES' - uses: ad-m/github-push-action@master - with: - github_token: ${{ inputs.secret }} - branch: ${{ steps.commit.outputs.dst_branch }} - directory: ${{ inputs.directory }} - repository: ${{ inputs.repository }} diff --git a/.github/workflows/sdk-generation.yml b/.github/workflows/sdk-generation.yml deleted file mode 100644 index afefb30..0000000 --- a/.github/workflows/sdk-generation.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Updating the SDK - -on: - workflow_dispatch: - push: - branches: - - master - - develop - -jobs: - updating_SDK: - name: Updating the SDK - runs-on: ubuntu-latest - - steps: - - name: Clone - uses: actions/checkout@v4 - with: - # by default the action uses fetch-depth = 1, which creates - # shallow repositories from which we can't push - fetch-depth: 0 - submodules: recursive - # needed, else the push inside the action will use default credentials - # instead of provided ones - persist-credentials: false - - - name: Build new SDK - run: ./tools/build_sdk.sh - - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - - name: Commit & push changes in the SDK if any - uses: ./.github/actions/commit-changes - with: - name: 'ldg-github-ci' - directory: ethereum-plugin-sdk - dst_branch: ${{ steps.extract_branch.outputs.branch }} - message: "[update] Branch ${{ steps.extract_branch.outputs.branch }} | Commit ${GITHUB_SHA}" - secret: ${{ secrets.CI_BOT_TOKEN }} - repository: LedgerHQ/ethereum-plugin-sdk - - - name: Create SDK update pull request - uses: peter-evans/create-pull-request@v4 - with: - branch: sdk/update-submodule - delete-branch: true - title: Update the SDK submodule - reviewers: apailler-ledger