diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml new file mode 100644 index 0000000..939e203 --- /dev/null +++ b/.github/workflows/push_pr.yml @@ -0,0 +1,74 @@ +on: + release: + types: [ created ] + +name: on-creating-new-tag + +jobs: + send-pull-requests: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Get production version from tag + id: get_version + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Checkout to repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.ACCESS_TOKEN }} + + - name: Create release file + run: | + TITLE='${{ github.event.release.name }}' + NOTES='${{ github.event.release.body }}' + DATE=$(date '+%d-%m-%Y') + mkdir -p deployments + echo $NOTES >> "deployments/release-$TITLE-$DATE.txt" + + git config user.email "curvefi@users.noreply.github.com" + git config user.name "curvefi" + git remote update + git fetch + git checkout master + git add deployments + git commit -m "chore: add release file - $TITLE" + git push + + - name: Checkout to other repo + uses: actions/checkout@v3 + with: + repository: curvefi/curve-js + token: ${{ secrets.ACCESS_TOKEN }} + + - name: Send pull-request to curve-js + run: | + TAG=${{ env.RELEASE_VERSION }} + ORG="curvefi" + CURRENT_REPOSITORY="$ORG/curve-xchain-factory" + REPOSITORY="$ORG/curve-js" + FOLDER="bin/$REPOSITORY" + BRANCH_NAME="deployment-$CURRENT_REPOSITORY-$TAG" + + # Setup the committers identity. + git config user.email "Curvefi@users.noreply.github.com" + git config user.name "Curvefi" + + # Create a new feature branch for the changes. + git checkout -b $BRANCH_NAME + + # Store the PAT in a file that can be accessed by the GitHub CLI. + echo "${{ secrets.ACCESS_TOKEN }}" > token.txt + + # Create an empty commit for PR + git commit --allow-empty -m "deployment from $CURRENT_REPOSITORY - $TAG" + git push -u origin $BRANCH_NAME + + # Authorize GitHub CLI for the current repository and + # create a pull-requests containing the updates. + gh auth login --with-token < token.txt + gh pr create \ + --body "Link to release: https://github.com/$CURRENT_REPOSITORY/releases/tag/$TAG" \ + --title "Deployment from $CURRENT_REPOSITORY - $TAG" \ + --head "$BRANCH_NAME" \ + --base "master" diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/curve-xchain-factory.iml b/.idea/curve-xchain-factory.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/curve-xchain-factory.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..f2ab48a --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..f9ece18 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a899ff4 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file