Skip to content

build: Icon generation workflow. #3

build: Icon generation workflow.

build: Icon generation workflow. #3

Workflow file for this run

name: Update Icons Pack
#on:
# repository_dispatch:
# types: [ plasma-released ]
on:
pull_request:
branches:
- develop
jobs:
icons:
runs-on: ubuntu-latest
steps:
# делаем сheckout в текущем репозитория
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
path: current
# делаем сheckout репозитория plasma
- name: Checkout to Plasma Web
uses: actions/checkout@v4
with:
repository: salute-developers/plasma
ref: dev
show-progress: false
path: plasma
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: 'plasma/.nvmrc'
- name: Install plasma web project deps
run: |
cd plasma
npm ci
- name: Generate android icons
run: |
cd plasma
npx lerna bootstrap --scope="@salutejs/plasma-icons" --ignore-scripts
npm run generate:android --prefix="packages/plasma-icons"
- name: Extract current version
id: extract_version
working-directory: ./current
shell: bash
run: sh ./.github/scripts/extract_version.sh ./sdds-core/icons/gradle.properties
- name: Create release branch
working-directory: ./current
run: |
git branch release/icons-v${{steps.extract_branch.outputs.branch.release_name}} develop
git checkout release/icons-v${{steps.extract_branch.outputs.branch.release_name}}
- name: Move generated icons to drawable folder
run: |
cp -r plasma/packages/plasma-icons/android-icons/. current/sdds-core/icons/src/main/res/drawable/
ls current/android-icons
- name: Create tag and release pull request
working-directory: ./current
shell: bash
run: |
TAG=icons-v${{steps.extract_branch.outputs.branch.release_name}}
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./sdds-core/icons/
git commit -m "feat(sdds-acore/icons): New icons were added"
git tag -a $TAG -m "Release $TAG"
git push --set-upstream origin release/$TAG
git push origin $TAG
gh pr create --base develop --head release/$TAG