From 6c27fef6709011776fb16da19a86b721b8aacc31 Mon Sep 17 00:00:00 2001 From: Ramesh Reddy Date: Thu, 4 Aug 2022 10:57:16 -0500 Subject: [PATCH] updatin with new ci-robot account --- .github/workflows/build.yml | 7 +++-- .github/workflows/release.yml | 13 +++++--- settings.xml | 56 ----------------------------------- 3 files changed, 14 insertions(+), 62 deletions(-) delete mode 100644 settings.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b118fede..5237eab8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,11 +12,15 @@ jobs: build: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{secrets.BF2ROBOT_TOKEN}} permissions: contents: read packages: write steps: - uses: actions/checkout@v2 + with: + token: ${{secrets.BF2ROBOT_TOKEN}} - name: Set up JDK 11 uses: actions/setup-java@v2 @@ -44,8 +48,7 @@ jobs: /usr/bin/sudo gpasswd -a $USER docker /usr/bin/sudo setfacl -m user:$USER:rw /var/run/docker.sock /usr/bin/sudo service docker restart - sed 's/{{TOKEN}}/${{ secrets.BF2_GITHUB_TOKEN }}/g' settings.xml > ~/settings.xml - mvn --batch-mode install -s ~/settings.xml --file pom.xml --no-transfer-progress -Dno-format -P docker -Ddocker.repo=${{ secrets.IMAGE_REPO_HOSTNAME }} -Ddocker.organization=${{ secrets.IMAGE_REPO_NAMESPACE }} + mvn --batch-mode install --file pom.xml -Dgithub.token=${{ secrets.GITHUB_TOKEN }} --no-transfer-progress -Dno-format -P docker -Ddocker.repo=${{ secrets.IMAGE_REPO_HOSTNAME }} -Ddocker.organization=${{ secrets.IMAGE_REPO_NAMESPACE }} docker login -u="${{ secrets.IMAGE_REPO_USERNAME }}" -p="${{ secrets.IMAGE_REPO_PASSWORD }}" ${{ secrets.IMAGE_REPO_HOSTNAME }} docker push ${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/openmessaging-benchmark:${{ steps.project.outputs.version }} docker tag ${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/openmessaging-benchmark:${{ steps.project.outputs.version }} ${{ secrets.IMAGE_REPO_HOSTNAME }}/${{ secrets.IMAGE_REPO_NAMESPACE }}/openmessaging-benchmark:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6db52896..8d3596d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,8 @@ jobs: name: release if: ${{github.event.pull_request.merged == true}} runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{secrets.BF2ROBOT_TOKEN}} permissions: contents: read packages: write @@ -20,11 +22,14 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 + with: + token: ${{secrets.BF2ROBOT_TOKEN}} - name: Retrieve Project Metadata uses: radcortez/project-metadata-action@243817f1e0f2b4df4e012fc17efc45cff166425d id: metadata with: + github-token: ${{secrets.GITHUB_TOKEN}} metadata-file-path: '.github/project.yml' local-file: true @@ -53,13 +58,13 @@ jobs: - name: Build and run Unit tests run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "bf2robot" + git config --global user.email "bf2-admin+bf2robot@redhat.com" git checkout -b release - mvn -B release:prepare -DpushChanges=false -s settings.xml -Dgithub.token=${{ secrets.GITHUB_TOKEN }} -P docker -DreleaseVersion=${{ steps.metadata.outputs.current-version }} -DdevelopmentVersion=${{ steps.metadata.outputs.next-version }} -Ddocker.repo=${{ secrets.IMAGE_REPO_HOSTNAME }} -Ddocker.organization=${{ secrets.IMAGE_REPO_NAMESPACE }} + mvn -B release:prepare -DpushChanges=false -Dgithub.token=${{ secrets.GITHUB_TOKEN }} -P docker -DreleaseVersion=${{ steps.metadata.outputs.current-version }} -DdevelopmentVersion=${{ steps.metadata.outputs.next-version }} -Ddocker.repo=${{ secrets.IMAGE_REPO_HOSTNAME }} -Ddocker.organization=${{ secrets.IMAGE_REPO_NAMESPACE }} git checkout ${{github.base_ref}} git rebase release - mvn -B release:perform -DlocalCheckout=true -s settings.xml -Dgithub.token=${{ secrets.GITHUB_TOKEN }} + mvn -B release:perform -DlocalCheckout=true -Dgithub.token=${{ secrets.GITHUB_TOKEN }} - name: docker push run: | diff --git a/settings.xml b/settings.xml deleted file mode 100644 index 57f6b39b..00000000 --- a/settings.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - github - - - - - github - - - central - https://repo1.maven.org/maven2 - - - github - https://maven.pkg.github.com/bf2fc6cc711aee1a0c2a/* - - true - - - - - - - - - github - bf2-ci-bot - {{TOKEN}} - - -