Skip to content

Merge pull request #190 from deriv-com/updates-icons #204

Merge pull request #190 from deriv-com/updates-icons

Merge pull request #190 from deriv-com/updates-icons #204

Workflow file for this run

name: Release
on:
push:
branches:
- master
- beta
- next
- '^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*|x)'
permissions:
contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
outputs:
RELEASE_VERSION: ${{ steps.extract_version.outputs.RELEASE_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
if: success()
run: npm audit signatures
- name: Release
if: success()
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN}}
run: npx semantic-release
- name: Extract Version
id: extract_version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "RELEASE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_OUTPUT"
- name: Trigger Quill Icons Park release
if: success()
env:
QUILL_ICONS_PARK_WORK_FLOW_FILE: 'pr_to_inform_quill_icons_update.yaml'
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.CI_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{github.repository}}/actions/workflows/$QUILL_ICONS_PARK_WORK_FLOW_FILE/dispatches \
-d '{"ref":"master"}'
send_slack_notification:
name: Send Release Slack notification
runs-on: ubuntu-latest
if: always()
needs: [release]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Conclusion
uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5
- name: Create Slack Message
id: create_slack_message
run: |
if [ "$WORKFLOW_CONCLUSION" == "success" ]; then
echo "MESSAGE=$RELEASE_TYPE ✅ The release for @deriv/quill-icons was successful, and the new version (${{ needs.release.outputs.RELEASE_VERSION }}) is now available." >> $GITHUB_OUTPUT
else
echo "MESSAGE=$RELEASE_TYPE 🤨 The release attempt for @deriv/quill-icons with version ${{ needs.release.outputs.RELEASE_VERSION }} was unsuccessful." >> $GITHUB_OUTPUT
fi
- name: Send Slack Notification
uses: 'deriv-com/shared-actions/.github/actions/send_slack_notification@master'
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: ${{ steps.create_slack_message.outputs.MESSAGE }}