From 419d41f9e0c80757d45fc895ddf9d3d198451ccc Mon Sep 17 00:00:00 2001 From: alisha-k-kalladassery Date: Mon, 19 Sep 2022 15:45:54 +0530 Subject: [PATCH] Testing Github workflows --- .github/workflows/.release.yml | 20 +++++++------- .github/workflows/createtagandrelease.yml | 29 +++++++++++++++++++++ .github/workflows/pullrequestforrelease.yml | 26 ++++++++++++++++++ 3 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/createtagandrelease.yml create mode 100644 .github/workflows/pullrequestforrelease.yml diff --git a/.github/workflows/.release.yml b/.github/workflows/.release.yml index d7092b3b..a84b6c9d 100644 --- a/.github/workflows/.release.yml +++ b/.github/workflows/.release.yml @@ -27,16 +27,16 @@ jobs: version=$(echo ${GITHUB_REF:10} | cut -c 2-) echo "GITHUB_VERSION=${version}" >> $GITHUB_ENV - - name: Login to Docker Hub - run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin + # - name: Login to Docker Hub + # run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - - name: Build the tagged Docker image - run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2 + # - name: Build the tagged Docker image + # run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2 - - name: Push the tagged Docker image - run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2 + # - name: Push the tagged Docker image + # run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-ansible-collection:${{ env.GITHUB_REF }}-OV7.2 - - name: Build and publish - run: | - ansible-galaxy collection build . - ansible-galaxy collection publish hpe-oneview-${{ env.GITHUB_VERSION }}.tar.gz --api-key="${{ secrets.GALAXY_API_TOKEN }}" + # - name: Build and publish + # run: | + # ansible-galaxy collection build . + # ansible-galaxy collection publish hpe-oneview-${{ env.GITHUB_VERSION }}.tar.gz --api-key="${{ secrets.GALAXY_API_TOKEN }}" diff --git a/.github/workflows/createtagandrelease.yml b/.github/workflows/createtagandrelease.yml new file mode 100644 index 00000000..affd0b83 --- /dev/null +++ b/.github/workflows/createtagandrelease.yml @@ -0,0 +1,29 @@ +name: create tag and relese + +on: + pull_request: + types: [closed] +jobs: + create-tag: + runs-on: ubuntu-latest + permissions: + contents: write + if: github.event.pull_request.merged && startsWith(github.head_ref, 'PR') && startsWith(github.base_ref, 'master') + steps: + - uses: actions/checkout@v2 + - name: Bump version and push tag + id: tag_and_prepare_release + uses: moble/github-tag-action@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + CUSTOM_TAG: "v7.2.1" + - name: Display + run: echo ${{ steps.tag_and_prepare_release.outputs.new_tag }} + - uses: actions/checkout@v2 + - uses: ncipollo/release-action@v1 + with: + name: ${{ steps.tag_and_prepare_release.outputs.new_tag }} + tag: ${{ steps.tag_and_prepare_release.outputs.new_tag }} + body: See the CHANGELOG.md for details. + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pullrequestforrelease.yml b/.github/workflows/pullrequestforrelease.yml new file mode 100644 index 00000000..9437fc6e --- /dev/null +++ b/.github/workflows/pullrequestforrelease.yml @@ -0,0 +1,26 @@ +name: Raise a Pullrequest + +on: + push: + branches: + - "PR" # Support wildcard matching + +jobs: + pull-request: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v2 + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + source_branch: "PR" # If blank, default: triggered branch + destination_branch: "master" # If blank, default: master + pr_label: "automation" + pr_title: "Testing Ansible Automation" # Title of pull request + pr_reviewer: "alisha-k-kalladassery" + pr_body: ":crown: *An automated PR*" # Full markdown support, requires pr_title to be set + pr_template: ".github/PULL_REQUEST_TEMPLATE.md" # Path to pull request template, requires pr_title to be set, excludes pr_body + pr_allow_empty: true + github_token: ${{ secrets.GITHUB_TOKEN }}