Skip to content

Commit

Permalink
feat(sdds-icore): added workflow to publish icons release
Browse files Browse the repository at this point in the history
  • Loading branch information
vkaltyrin committed Apr 9, 2024
1 parent 6ac5376 commit b0b7f72
Show file tree
Hide file tree
Showing 45 changed files with 11 additions and 334 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,22 @@ jobs:
- name: Build SDDSIcons
run: |
xcodebuild -project SDDSIcons/SDDSIcons.xcodeproj -scheme "Build XCFramework" BUILD_DIR=./build
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"
zip -r "${TAG_NAME}.zip" ./SDDSIcons/build/SDDSIcons.xcframework
cd SDDSIcons
mv build $TAG_NAME
zip -r ./../$TAG_NAME.zip $TAG_NAME/SDDSIcons.xcframework
echo "::set-output name=zip_path::${TAG_NAME}.zip"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.zip_artifact.outputs.zip_path }}
tag_name: github.ref
tag_name: ${{ github.ref }}
token: ${{ secrets.GH_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/update_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
repository: salute-developers/plasma
#ref: ${{ github.event.client_payload.ref || github.event.inputs.plasma-ref }}
ref: feat-icons-png-generator
ref: dev
show-progress: false
path: plasma

Expand Down Expand Up @@ -106,4 +106,6 @@ jobs:
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"
git tag $TAG
git push origin $TAG
gh pr create --base develop --head release/$TAG --title "Release $TAG" --body "Icons were updated to v$PLASMA_VER"
4 changes: 0 additions & 4 deletions SDDSDemoApp/SDDSDemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
242BF2452BBC616400E4D112 /* SDDSCore.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DEDA2BB5CE5100277123 /* SDDSCore.xcframework */; };
242BF2462BBC616400E4D112 /* SDDSCore.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DEDA2BB5CE5100277123 /* SDDSCore.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2430DEE02BB5CE5100277123 /* SDDSIcons.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DEDB2BB5CE5100277123 /* SDDSIcons.xcframework */; };
2430DEE12BB5CE5100277123 /* SDDSIcons.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DEDB2BB5CE5100277123 /* SDDSIcons.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2430DEE22BB5CE5100277123 /* SDDSSwiftUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DEDC2BB5CE5100277123 /* SDDSSwiftUI.xcframework */; };
Expand Down Expand Up @@ -50,7 +48,6 @@
files = (
2430DEE52BB5CE5100277123 /* SDDSUIKit.xcframework in Embed Frameworks */,
2430DEE12BB5CE5100277123 /* SDDSIcons.xcframework in Embed Frameworks */,
242BF2462BBC616400E4D112 /* SDDSCore.xcframework in Embed Frameworks */,
2430DEE32BB5CE5100277123 /* SDDSSwiftUI.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
Expand Down Expand Up @@ -82,7 +79,6 @@
files = (
2430DEE42BB5CE5100277123 /* SDDSUIKit.xcframework in Frameworks */,
2430DEE02BB5CE5100277123 /* SDDSIcons.xcframework in Frameworks */,
242BF2452BBC616400E4D112 /* SDDSCore.xcframework in Frameworks */,
2430DEE22BB5CE5100277123 /* SDDSSwiftUI.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

9 changes: 1 addition & 8 deletions SDDSDemoApp/SDDSDemoApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ struct ContentView: View {
Color.red.opacity(0.3)
.ignoresSafeArea()
VStack {
if let bundle = bundle {
Image("testIcon2")
.fixedSize()
.frame(width: 100, height: 100)
.foregroundColor(.red)
} else {
Text("no bundle")
}
Text("no bundle")
}
.padding()
}
Expand Down
13 changes: 0 additions & 13 deletions SDDSIcons.podspec

This file was deleted.

80 changes: 0 additions & 80 deletions SDDSIcons/Generated/Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,98 +12,18 @@
#endif

// Deprecated typealiases
@available(*, deprecated, renamed: "ImageAsset.Image", message: "This typealias will be removed in SwiftGen 7.0")
public typealias AssetImageTypeAlias = ImageAsset.Image

// swiftlint:disable superfluous_disable_command file_length implicit_return

// MARK: - Asset Catalogs

// swiftlint:disable identifier_name line_length nesting type_body_length type_name
public enum Asset {
public static let apple = ImageAsset(name: "Apple")
public static let google = ImageAsset(name: "Google")
public static let meta = ImageAsset(name: "Meta")
public static let microsoft = ImageAsset(name: "Microsoft")
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name

// MARK: - Implementation Details

public struct ImageAsset {
public fileprivate(set) var name: String

#if os(iOS) || os(tvOS) || os(watchOS)
public typealias Image = UIImage
#endif

@available(iOS 8.0, tvOS 9.0, watchOS 2.0, macOS 10.7, *)
public var uiImage: Image {
let bundle = BundleToken.bundle
#if os(iOS) || os(tvOS)
let image = Image(named: name, in: bundle, compatibleWith: nil)
#elseif os(watchOS)
let image = Image(named: name)
#endif
guard let result = image else {
fatalError("Unable to load image asset named \(name).")
}
return result
}

#if os(iOS) || os(tvOS)
@available(iOS 8.0, tvOS 9.0, *)
public func image(compatibleWith traitCollection: UITraitCollection) -> Image {
let bundle = BundleToken.bundle
guard let result = Image(named: name, in: bundle, compatibleWith: traitCollection) else {
fatalError("Unable to load image asset named \(name).")
}
return result
}
#endif

#if canImport(SwiftUI)
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public var image: SwiftUI.Image {
SwiftUI.Image(asset: self)
}
#endif
}

public extension ImageAsset.Image {
@available(iOS 8.0, tvOS 9.0, watchOS 2.0, *)
@available(macOS, deprecated,
message: "This initializer is unsafe on macOS, please use the ImageAsset.image property")
convenience init?(asset: ImageAsset) {
#if os(iOS) || os(tvOS)
let bundle = BundleToken.bundle
self.init(named: asset.name, in: bundle, compatibleWith: nil)
#elseif os(watchOS)
self.init(named: asset.name)
#endif
}
}

#if canImport(SwiftUI)
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public extension SwiftUI.Image {
init(asset: ImageAsset) {
let bundle = BundleToken.bundle
self.init(asset.name, bundle: bundle)
}

init(asset: ImageAsset, label: Text) {
let bundle = BundleToken.bundle
self.init(asset.name, bundle: bundle, label: label)
}

init(decorative asset: ImageAsset) {
let bundle = BundleToken.bundle
self.init(decorative: asset.name, bundle: bundle)
}
}
#endif

// swiftlint:disable convenience_type
private final class BundleToken {
static let bundle: Bundle = {
Expand Down
3 changes: 0 additions & 3 deletions SDDSIcons/SDDSIcons.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

/* Begin PBXBuildFile section */
242BF2422BBC600D00E4D112 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 242BF2412BBC600D00E4D112 /* Assets.xcassets */; };
242BF2442BBC610200E4D112 /* SDDSIcons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 242BF2432BBC610200E4D112 /* SDDSIcons.swift */; };
242BF24F2BBC687700E4D112 /* Assets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 242BF24E2BBC687700E4D112 /* Assets.swift */; };
2430DEA02BB5B53B00277123 /* SDDSIcons.docc in Sources */ = {isa = PBXBuildFile; fileRef = 2430DE9F2BB5B53B00277123 /* SDDSIcons.docc */; };
2430DEA62BB5B53B00277123 /* SDDSIcons.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2430DE9B2BB5B53B00277123 /* SDDSIcons.framework */; };
Expand All @@ -42,7 +41,6 @@

/* Begin PBXFileReference section */
242BF2412BBC600D00E4D112 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
242BF2432BBC610200E4D112 /* SDDSIcons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDDSIcons.swift; sourceTree = "<group>"; };
242BF2472BBC673300E4D112 /* swiftgen.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = swiftgen.yml; sourceTree = "<group>"; };
242BF24E2BBC687700E4D112 /* Assets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Assets.swift; sourceTree = "<group>"; };
242BF2552BBD8AB000E4D112 /* assets.stencil */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = assets.stencil; sourceTree = "<group>"; };
Expand Down Expand Up @@ -139,7 +137,6 @@
2430DE9E2BB5B53B00277123 /* SDDSIcons.h */,
2430DE9F2BB5B53B00277123 /* SDDSIcons.docc */,
242BF2412BBC600D00E4D112 /* Assets.xcassets */,
242BF2432BBC610200E4D112 /* SDDSIcons.swift */,
);
path = SDDSIcons;
sourceTree = "<group>";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions SDDSIcons/SDDSIcons/Assets.xcassets/Apple.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions SDDSIcons/SDDSIcons/Assets.xcassets/Google.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions SDDSIcons/SDDSIcons/Assets.xcassets/Meta 1.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions SDDSIcons/SDDSIcons/Assets.xcassets/Meta.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b0b7f72

Please sign in to comment.