From dce6022cb6f5ec04d3f1b0d3408a6d7fd4746947 Mon Sep 17 00:00:00 2001 From: meysamhadeli Date: Sun, 29 Jan 2023 18:40:13 +0330 Subject: [PATCH] ci: Update github-actions for using reusable workflow --- .github/workflows/ci.yml | 8 ++---- .../workflows/reusable-release-drafter.yml | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/reusable-release-drafter.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66ed5ab..0647548 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ on: branches: [ "main" , "develop" ] paths-ignore: - "README.md" + workflow_dispatch: jobs: build: @@ -38,12 +39,9 @@ jobs: - name: Test run: dotnet test -c Release --no-restore - - name: Update Release Drafter + - name: Call Update Release Drafter if: ${{ github.ref == 'refs/heads/main' && success() }} - id: last_release - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ./.github/workflows/reusable-release-drafter.yml ##ref: https://docs.docker.com/language/golang/configure-ci-cd/ ##ref: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions diff --git a/.github/workflows/reusable-release-drafter.yml b/.github/workflows/reusable-release-drafter.yml new file mode 100644 index 0000000..f8e0b06 --- /dev/null +++ b/.github/workflows/reusable-release-drafter.yml @@ -0,0 +1,28 @@ +name: Reusable Release Drafter + +on: + push: + branches: [ "main" , "develop" ] + paths-ignore: + - "README.md" + pull_request: + branches: [ "main" , "develop" ] + paths-ignore: + - "README.md" + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Update Release Drafter + if: ${{ github.ref == 'refs/heads/main'}} + id: last_release + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +