From 8ed5844313127d07da1bf0d140ec1f33e699a691 Mon Sep 17 00:00:00 2001 From: Mustafa Ozhan Date: Sun, 21 Jan 2024 00:14:29 +0200 Subject: [PATCH] [Oztechan/Global#94] Add Release publishing reusable workflow (#95) --- .github/workflows/publish.yml | 12 ++++++++ .github/workflows/reusable-publish.yml | 38 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/reusable-publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..30c749b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,12 @@ +name: Publish Release + +on: + push: + tags: + - "v*" + +jobs: + + PublishRelease: + uses: Oztechan/Global/.github/workflows/reusable-publish.yml@develop + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/reusable-publish.yml b/.github/workflows/reusable-publish.yml new file mode 100644 index 0000000..4af2dee --- /dev/null +++ b/.github/workflows/reusable-publish.yml @@ -0,0 +1,38 @@ +name: Publish Release + +on: + workflow_call: + +jobs: + + PublishRelease: + runs-on: ubuntu-latest + outputs: + status: ${{ steps.status.outputs.status }} + steps: + + - name: PublishRelease + uses: marvinpinto/action-automatic-releases@v1.2.1 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + prerelease: false + + - name: Set Job Status + id: status + run: echo "status=success" >> $GITHUB_OUTPUT + + Notify: + runs-on: ubuntu-latest + needs: [ PublishRelease ] + if: always() + steps: + + - name: Notify slack fail + if: false == (needs.PublishRelease.outputs.status == 'success') + uses: voxmedia/github-action-slack-notify-build@v1.6.0 + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + with: + channel: ccc-github + status: FAILED + color: danger