Skip to content

Commit

Permalink
Release SDDSIcons-v0.1.0 (#23)
Browse files Browse the repository at this point in the history
* chore: Added an initial Xcode project structure. Added license, readme.

* fix(sdds-icore): Updated minimum deployment target

* chore: Updated minimum deployment target

* feat(sdds-icore): implemented building and archiving of XCFrameworks (#2)

* feat(sdds-icore): added workflows to run SwiftLint and unit tests (#4)

* Added swiftgen and added workflow to release icons (#8)

* feat(sdds-icore): added workflow to publish icons release

* feat(sdds-icore): added generation of assets

* feat(sdds-icore): added swiftgen and added workflow to release icons (#8)

* Added workflow to update icons (#5)

* feat(sdds-icore): added workflows to release icons

* feat(sdds-icore): added workflow to publish icons release

* build: utilized ref from payload

* build: added workflow to create and push release tag (#17)

* build: added workflow to create and push release tag

* build: set ubuntu instead of macos

* build: bump version (#20)

* chore: improved release name (#22)

* feat(sdds-acore/icons): New icons were added from plasma v1.0.0

---------

Co-authored-by: Salute iOS Team <[email protected]>
  • Loading branch information
vkaltyrin and Salute iOS Team authored Apr 10, 2024
1 parent 537213a commit 82bd97c
Show file tree
Hide file tree
Showing 4,173 changed files with 29,958 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Debug / Build debug artifacts

on:
pull_request:

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
environment: sdds

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'

- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Run build script
run: |
chmod +x ./scripts/build.sh
./scripts/build.sh
- name: Upload XCFrameworks as Artifact
uses: actions/[email protected]
with:
name: xcframeworks
path: build/**
57 changes: 57 additions & 0 deletions .github/workflows/create_tag_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Create tag and release'

on:
workflow_dispatch:
inputs:
versionName:
description: 'Version Name'
required: true

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
tag-release:
name: Build release artifacts
runs-on: ubuntu-latest
environment: sdds
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GH_TOKEN }}

- name: Retrieve tag exists flag
uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ github.event.inputs.versionName }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Verify tag not exists
run: |
if [ ${{ steps.checkTag.outputs.exists }} == true ]; then exit 1; else exit 0; fi
- name: Create and push tag
run: |
git config --global user.email "[email protected]"
git config --global user.name "Salute iOS Team"
git tag -a $TAG -m "Release $TAG"
git push origin $TAG
env:
TAG: ${{ github.event.inputs.versionName }}

- name: Create Release on GitHub
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.event.inputs.versionName }}
release_name: ${{ github.event.inputs.versionName }}
draft: true
prerelease: false
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code Quality Check / Perform static analysis

on:
pull_request:
paths:
- '.github/workflows/lint.yml'
- '.swiftlint.yml'
- '**/*.swift'

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
SwiftLint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run SwiftLint
uses: norio-nomura/[email protected]
73 changes: 73 additions & 0 deletions .github/workflows/release_icons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 'Publish icons Release'

on:
push:
tags:
- "SDDSIcons-v[0-9]+.[0-9]+.[0-9]+"

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
generate-distribution:
name: Generate icons distribution zip
runs-on: macos-latest
environment: sdds
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'

- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Build SDDSIcons
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
xcodebuild -project SDDSIcons/SDDSIcons.xcodeproj -scheme "Build XCFramework"
- name: Generate distribution zip
id: zip_artifact
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "Tag name: $TAG_NAME"
cd SDDSIcons
mv build $TAG_NAME
zip -r ./../$TAG_NAME.zip $TAG_NAME/SDDSIcons.xcframework
echo "::set-output name=zip_path::${TAG_NAME}.zip"
echo "::set-output name=release_title::${TAG_NAME}"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.zip_artifact.outputs.zip_path }}
tag_name: ${{ steps.zip_artifact.outputs.release_title }}
token: ${{ secrets.GH_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Quality Check / Perform Unit Testing

on:
pull_request:

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
environment: sdds

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'

- name: Run tests
run: |
chmod +x ./scripts/test.sh
./scripts/test.sh
108 changes: 108 additions & 0 deletions .github/workflows/update_icons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Update Icons Pack

on:
workflow_dispatch:
inputs:
plasma-ref:
required: true
default: master
plasma-version:
required: true
repository_dispatch:
types: [ build-icons ]

jobs:
icons:
runs-on: macos-latest
environment: sdds
env:
lerna-scope: '--scope="@salutejs/plasma-icons"'

steps:
# делаем сheckout в текущем репозитория
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
fetch-depth: 0
path: current

# делаем сheckout репозитория plasma
- name: Checkout to Plasma Web
uses: actions/checkout@v4
with:
repository: salute-developers/plasma
ref: ${{ github.event.client_payload.ref || github.event.inputs.plasma-ref }}
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
working-directory: ./plasma
run: npm ci

- name: Install plasma-icons
working-directory: ./plasma
run: |
npx lerna bootstrap ${{ env.lerna-scope }}
- name: Generate iOS icons
working-directory: ./plasma
run: |
npx lerna ${{ env.lerna-scope }} run generate:ios
- name: Extract current version
id: extract_version
working-directory: ./current
shell: bash
run: |
VER=$(grep -A1 'CFBundleShortVersionString' ./SDDSIcons/info.plist | awk -F'[<>]' '/string/{print $3; exit}')
echo "CFBundleVersion is $VER"
echo "tag=SDDSIcons-v$VER" >> $GITHUB_OUTPUT
- name: Verify release branch not exists
working-directory: ./current
shell: bash
run: |
git fetch --all
if git branch -a | grep -q release/${{ steps.extract_version.outputs.tag }}; then exit 1; else exit 0; fi
- name: Create release branch
working-directory: ./current
shell: bash
run: |
git fetch --all
git checkout -b release/${{steps.extract_version.outputs.tag}}
- name: Move generated icons to XCAssets
run: cp -rf plasma/packages/plasma-icons/icons-ios/. current/SDDSIcons/SDDSIcons/Assets.xcassets

- name: Install SwiftGen
run: |
brew install swiftgen
- name: Run SwiftGen
working-directory: ./current
run: |
cd SDDSIcons
swiftgen
- name: Create tag and release pull request
working-directory: ./current
shell: bash
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
TAG=${{steps.extract_version.outputs.tag}}
PLASMA_VER=${{ github.event.client_payload.version || github.event.inputs.plasma-version }}
git config --local user.email "[email protected]"
git config --local user.name "Salute iOS Team"
git add ./SDDSIcons/SDDSIcons/Assets.xcassets/
git add ./SDDSIcons/Generated/Assets.swift
git commit -m "feat(sdds-acore/icons): New icons were added from plasma v$PLASMA_VER"
git push --set-upstream origin release/$TAG
gh pr create --base main --head release/$TAG --title "Release $TAG" --body "Icons were updated to v$PLASMA_VER"
Loading

0 comments on commit 82bd97c

Please sign in to comment.