@salutejs/[email protected] #3636
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Создаем custom событие "build-icons" на это событие есть подписка в android repo | |
name: Dispatch build-icons event | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
default: 'master' | |
description: '' | |
required: false | |
version: | |
description: 'Version plasma-icons package' | |
required: true | |
repo: | |
description: 'Repo target' | |
required: true | |
default: 'plasma-android' | |
release: | |
types: [published] | |
jobs: | |
dispatch-manual: | |
name: "Dispatch event by workflow_dispatch" | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dispatch custom event | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/salute-developers/${{ github.event.inputs.repo }}/dispatches \ | |
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"${{github.event.inputs.version}}\", \"ref\": \"${{github.event.inputs.ref}}\"}}" | |
dispatch-published: | |
name: "Dispatch event after release published" | |
if: ${{ github.event_name == 'release' && !github.event.release.prerelease && contains(github.event.release.name, 'plasma-icons@') }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get package version | |
run: | | |
echo "VERSION=$(echo "${{ github.event.release.tag_name }}" | cut -d '@' -f 3)" >> "$GITHUB_ENV" | |
- name: Dispatch custom event to android | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/salute-developers/plasma-android/dispatches \ | |
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"$VERSION\", \"ref\": \"master\"}}" | |
- name: Dispatch custom event to iOS | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/salute-developers/plasma-ios/dispatches \ | |
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"$VERSION\", \"ref\": \"master\"}}" |