Skip to content

Commit

Permalink
Merge pull request #193 from yaswanth-deriv/fix-version
Browse files Browse the repository at this point in the history
[FEQ]Yaswanth/FEQ-1233/To fix version issue
  • Loading branch information
ali-hosseini-deriv authored Jan 10, 2024
2 parents 4692bb1 + 2dabda0 commit 7e4615f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/actions/send_slack_notifications/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"text": "${{ inputs.RELEASE_TYPE }} Release succeeded for dsmarttrader.deriv.com with version ${{ inputs.VERSION }}"
"text": "${{ inputs.RELEASE_TYPE }} Release succeeded for developers.binary.com with version ${{ inputs.VERSION }}"
}' \
${{ inputs.SLACK_WEBHOOK_URL }}
shell: bash
Expand All @@ -33,7 +33,7 @@ runs:
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{
"text": "${{ inputs.RELEASE_TYPE }} Release failed for dsmarttrader.deriv.com with version ${{ inputs.VERSION }}"
"text": "${{ inputs.RELEASE_TYPE }} Release failed for developers.binary.com with version ${{ inputs.VERSION }}"
}' \
${{ inputs.SLACK_WEBHOOK_URL }}
shell: bash
8 changes: 8 additions & 0 deletions .github/actions/versioning/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ inputs:
RELEASE_TYPE:
description: Release Type
required: false
outputs:
version:
description: Version

runs:
using: composite
steps:
- name: Tag build
run: echo "${GITHUB_REF#refs/heads/} $(date -u +'%Y-%m-%dT%H:%M:%SZ')" > _site/version
shell: bash
- name: Set Version
id: set_version
run: |
echo "version=${GITHUB_REF#refs/heads/} $(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
shell: bash
9 changes: 7 additions & 2 deletions .github/workflows/release-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
build_test_and_publish:
name: Build, Test and Publish to Production
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.extract_version.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,6 +25,9 @@ jobs:
uses: ./.github/actions/versioning
with:
release_type: production
- name: Extract version
id: extract_version
run: echo "RELEASE_VERSION=${version}" >> $GITHUB_OUTPUT
- name: Publish to Cloudflare Pages Production
uses: "./.github/actions/publish_to_pages_production"
with:
Expand All @@ -39,7 +44,7 @@ jobs:
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
CA_CRT: ${{ secrets.CA_CRT }}
APP_VERSION: latest


send_slack_notification:
name: Send Slack notification
Expand All @@ -57,4 +62,4 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
status: ${{ env.WORKFLOW_CONCLUSION }}
release_type: Production
version: $GITHUB_REF_NAME
version: ${{ needs.build_test_and_publish.outputs.RELEASE_VERSION }}

0 comments on commit 7e4615f

Please sign in to comment.