Skip to content

Commit

Permalink
GitHub migration (microsoft#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickromano authored May 31, 2020
1 parent fd893c8 commit ce3dd40
Show file tree
Hide file tree
Showing 22 changed files with 1,107 additions and 395 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Pull request validation

on: pull_request

jobs:
build-ios:
name: Build iOS library
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node 11
uses: actions/setup-node@v1
with:
node-version: 11.x

- run: npm install
working-directory: importer

- name: Run generate script
run: npm run deploy:ios
working-directory: importer

build-android:
name: Build Android library
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node 11
uses: actions/setup-node@v1
with:
node-version: 11.x

- run: npm install
working-directory: importer

- name: Run generate script
run: npm run deploy:android
working-directory: importer

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11

# https://github.com/marketplace/actions/gradle-command
- name: Build Android library
uses: eskatos/gradle-command-action@v1
with:
arguments: assembleRelease
build-root-directory: android
wrapper-directory: android
150 changes: 150 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Publish library

on:
push:
branches: [ master ]

env:
LIBRARY_VERSION: 1.1.${{ github.run_number }}

jobs:
publish-library:
name: Publish mobile libraries
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Bump version patch
run: |
grep -E "[0-9]+\.[0-9]+\.[0-9]+" FluentIcons.podspec |
python3 -c """
import sys
current_version = sys.stdin.read().strip().split(\"'\")[1]
major, minor, patch = current_version.split('.')
print(f'::set-env name=NEW_VERSION::{major}.{minor}.{int(patch) + 1}')
"""
- name: Use Node 11
uses: actions/setup-node@v1
with:
node-version: 11.x

- run: npm install
working-directory: importer

## iOS
- name: Run iOS generate script
run: npm run deploy:ios
working-directory: importer

## Android
- name: Run Android generate script
run: npm run deploy:android
working-directory: importer

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8

- name: Build and publish Android library
uses: eskatos/gradle-command-action@v1
with:
arguments: bintrayUpload -DversionName=${{ env.NEW_VERSION }} -DbintrayUser=${{ secrets.BINTRAY_USER }} -DbintrayKey=${{ secrets.BINTRAY_KEY }}
build-root-directory: android
wrapper-directory: android

## Publish
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version numbers in README.md
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" README.md
rm README.md.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version numbers in ios/README.md
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" ios/README.md
rm ios/README.md.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in Podspec
run: |
sed -i.bk -r "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" ios/FluentIcons.podspec
rm ios/FluentIcons.podspec.bk
- name: Update icon sheet
run: python3 generate_icons_md.py

- name: Config git credentials
run: git config user.email "[email protected]" && git config user.name "Fluent Build System"

- name: Commit version number change
run: |
git add -A
git commit -m "Release $NEW_VERSION"
- name: Tag release
run: git tag "$NEW_VERSION"

- name: Push release
run: |
REMOTE_REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push $REMOTE_REPO HEAD:master --follow-tags --tags
publish-android-demo:
name: Publish Android demo app
runs-on: ubuntu-latest
needs: publish-library

steps:
- uses: actions/checkout@v2

- name: Bump version patch
run: |
grep -E "[0-9]+\.[0-9]+\.[0-9]+" FluentIcons.podspec |
python3 -c """
import sys
current_version = sys.stdin.read().strip().split(\"'\")[1]
major, minor, patch = current_version.split('.')
print(f'::set-env name=NEW_VERSION::{major}.{minor}.{int(patch) + 1}')
"""
- name: Use Node 11
uses: actions/setup-node@v1
with:
node-version: 11.x

- run: npm install
working-directory: importer

- name: Run generate script
run: npm run deploy:android
working-directory: importer

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8

- name: Restore release keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" > release.keystore.asc
gpg -d --passphrase "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" --batch release.keystore.asc > release.keystore
- name: Build Android demo app
uses: eskatos/gradle-command-action@v1
with:
arguments: ':sample-showcase:assembleRelease -DversionName=${{ env.NEW_VERSION }} -DversionCode=${{ github.run_number }} -Pandroid.injected.signing.store.file=/home/runner/work/fluent-system-icons/fluent-system-icons/release.keystore -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.ANDROID_KEYSTORE_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}'
build-root-directory: android
wrapper-directory: android

- name: Publish apk to App Center
uses: wzieba/[email protected]
with:
appName: ${{ secrets.APP_CENTER_DEMO_APP_NAME }}
token: ${{ secrets.APP_CENTER_TOKEN }}
group: Public
file: android/sample-showcase/build/outputs/apk/release/sample-showcase-release.apk
releaseNotes: Please enjoy this latest version(${{ env.NEW_VERSION }}) of Fluent System Icons Demo.
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Fluent System Icons

![CI](https://github.com/microsoft/fluent-system-icons/workflows/CI/badge.svg)

Fluent System Icons is a set of mobile platform icons from Microsoft.

![fluent system icons](art/readme-asset.png)

## Icon List

[View the full list of icons](icons.md)

## Installation
### Android
Add the `microsoftdesign` repository to your project's top level `build.gradle`:
The library is published via JCenter, please ensure that the `jcenter()` repository has been added to the root `build.gradle` file:
```groovy
repositories {
maven {
name 'vsts-maven-microsoftdesign'
url 'https://pkgs.dev.azure.com/microsoftdesign/951975d5-69cc-4771-9d98-92a4b1a82b2b/_packaging/fluent-icons/maven/v1'
credentials {
username = [Your VSTS username]
password = [Your VSTS access token]
}
}
...
jcenter()
}
```
Include the following dependency in your project's `build.gradle`
```groovy
implementation 'com.microsoft.design:fluent-icons:1.0.226'
implementation 'com.microsoft.design:fluent-system-icons:1.1.2'
```

For library docs, see [android/README.md](android/README.md).
Expand All @@ -30,13 +30,13 @@ For library docs, see [android/README.md](android/README.md).
#### Cocoapods

```ruby
pod "FluentIcons", git: "https://[email protected].com/microsoftdesign/Design%20System/_git/fluent-mobile-icons", tag: "1.0.226"
pod "FluentIcons", git: "https://github.com/microsoft/fluent-system-icons.git", tag: "1.1.2"
```

#### Carthage

```bash
git "git@ssh.dev.azure.com:v3/microsoftdesign/Design%20System/fluent-mobile-icons" "1.0.226"
git "git@github.com:microsoft/fluent-system-icons.git" "1.1.2"
```

For library docs, see [ios/README.md](ios/README.md).
Expand Down Expand Up @@ -65,20 +65,17 @@ npm run

### Build Pipeline

Our [build pipeline](https://dev.azure.com/microsoftdesign/Design%20System/_build?definitionId=94&_a=summary) runs `deploy:android` and `deploy:ios` to create the libraries. The build definitions are in `azure-pipelines.yml` and `pipelines`.
Our [build pipeline](https://github.com/microsoft/fluent-system-icons/actions) runs `deploy:android` and `deploy:ios` to create the libraries. The build definitions are located in `.github/workflows/`.

## Demo apps

You can download the demo apps from AppCenter or build them following the steps below.

### Android ([Download](https://install.appcenter.ms/orgs/Fluent-Design-Mobile/apps/Fluent-Mobile-Icons-Demo))
1. Open the [android](android) directory in Android Studio
2. Select the `sample-showcase` in the build configuration dropdown
3. Click run
You can build and run the demo apps following the steps below.

### Mac ([Download](https://install.appcenter.ms/orgs/Fluent-Design-Mobile/apps/Fluent-Mac-App))
1. `open ios/FluentIcons.xcworkspace/`
2. Product > Run
### Android
1. Follow the **Importer** section above and run the command `npm run deploy:android`
2. Open the [android](android) directory in Android Studio
3. Select the `sample-showcase` in the build configuration dropdown
4. Click run

## Contact
Please feel free to reach out to the following points of contact with questions or requests.
Expand All @@ -87,4 +84,4 @@ Please feel free to reach out to the following points of contact with questions
* [Will Hou](mailto:[email protected]) - Android

## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct) or contact [email protected] with any additional questions or comments.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct) or contact [email protected] with any additional questions or comments.
2 changes: 1 addition & 1 deletion android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ buildTypes {
}
}
```
~~If you prefer to only exclude the Fluent icons, please save the [keep.xml](android/sample-shrinkresources/src/main/res/raw/keep.xml) file at your project's `res/raw` directory. Please see this [Android developer guide](https://developer.android.com/studio/build/shrink-code#shrink-resources) for details about shrinking resources~~
If you prefer to only exclude the Fluent icons, please save the [keep.xml](sample-shrinkresources/src/main/res/raw/keep.xml) file at your project's `res/raw` directory. Please see this [Android developer guide](https://developer.android.com/studio/build/shrink-code#shrink-resources) for details about shrinking resources.
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.3.71'
ext.appCenterSdkVersion = '2.5.1'
ext.bintray_version = '1.8.5'
repositories {
google()
jcenter()
Expand All @@ -11,6 +12,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion android/library/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
POM_GROUP_ID=com.microsoft.design
POM_ARTIFACT_ID=fluent-icons
POM_ARTIFACT_ID=fluent-system-icons
VERSION_NAME=1.0.0
21 changes: 13 additions & 8 deletions android/library/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

project.afterEvaluate {
publishing {
Expand All @@ -7,18 +8,22 @@ project.afterEvaluate {
groupId project.POM_GROUP_ID
artifactId project.POM_ARTIFACT_ID
version System.getProperty("versionName", project.VERSION_NAME + "-SNAPSHOT")

artifact bundleReleaseAar
}
}
}

repositories {
maven {
url 'https://pkgs.dev.azure.com/microsoftdesign/951975d5-69cc-4771-9d98-92a4b1a82b2b/_packaging/fluent-icons/maven/v1'
credentials {
username "microsoftdesign"
password System.getProperty("vstsAccessToken", "")
}
bintray {
user = System.getProperty('bintrayUser')
key = System.getProperty('bintrayKey')
publications = ['fluenticons']
publish = true
pkg {
repo = 'fluent-design'
name = 'fluent-system-icons'
version {
name = System.getProperty("versionName", project.VERSION_NAME + "-SNAPSHOT")
vcsTag = System.getProperty("versionName", project.VERSION_NAME + "-SNAPSHOT")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/sample-showcase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
applicationId "com.microsoft.fluent.mobile.icons.sample"
minSdkVersion 21
targetSdkVersion 29
versionCode Integer.parseInt(System.getProperty("versionCode", "1.0.1").substring(4))
versionCode Integer.parseInt(System.getProperty("versionCode", "1"))
versionName System.getProperty("versionName", "1.0.0")

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion android/sample-shrinkresources/src/main/res/raw/keep.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->

<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/*,@color/*,@layout/*,@xml/*,@dimen/*,@integer/*,@bool/*,@anim/*,@menu/*,@string/*,@array/*,@plurals/*,@style/*,@font/*"
tools:shrinkMode="strict"
tools:discard="@drawable/ic_fluent_*" />
<!--
Save this file at your project's res/raw directory to exclude unused icons in build time.
Expand Down
Loading

0 comments on commit ce3dd40

Please sign in to comment.