Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[potatotips #70] license-list-pluginを使ってOSSライセン...

syarihu
July 10, 2020

[potatotips #70] license-list-pluginを使ってOSSライセンス画面を自動生成する / license-list-plugin

オンライン開催されたpotatotips #70で発表した資料です。
https://potatotips.connpass.com/event/178565/

syarihu

July 10, 2020
Tweet

More Decks by syarihu

Other Decks in Technology

Transcript

  1. Dangerfile - 依存関係が更新されている場合はラベルをつける begin target_branch = github.branch_for_base.match(/release|develop/) is_dependencies_updated = git.modified_files.grep(/.*Dep.kt/).empty?

    if target_branch && !is_dependencies_updated pr_number = github.pr_json["number"] auto_label.set(pr_number, "Update licenses", "#1d76db") end end
  2. Dangerfile - 依存関係が更新されている場合はラベルをつける begin target_branch = github.branch_for_base.match(/release|develop/) is_dependencies_updated = git.modified_files.grep(/.*Dep.kt/).empty?

    if target_branch && !is_dependencies_updated pr_number = github.pr_json["number"] auto_label.set(pr_number, "Update licenses", "#1d76db") end end
  3. Dangerfile - 依存関係が更新されている場合はラベルをつける begin target_branch = github.branch_for_base.match(/release|develop/) is_dependencies_updated = git.modified_files.grep(/.*Dep.kt/).empty?

    if target_branch && !is_dependencies_updated pr_number = github.pr_json["number"] auto_label.set(pr_number, "Update licenses", "#1d76db") end end
  4. Dangerfile - 依存関係が更新されている場合はラベルをつける begin target_branch = github.branch_for_base.match(/release|develop/) is_dependencies_updated = git.modified_files.grep(/.*Dep.kt/).empty?

    if target_branch && !is_dependencies_updated pr_number = github.pr_json["number"] auto_label.set(pr_number, "Update licenses", "#1d76db") end end
  5. .github/workflow.yml - 特定のラベルのみジョブを実行する jobs: build: runs-on: ubuntu-latest if: github.event.label.name ==

    'Update licenses' steps: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8
  6. .github/workflow.yml - 特定のラベルのみジョブを実行する jobs: build: runs-on: ubuntu-latest if: github.event.label.name ==

    'Update licenses' steps: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8
  7. .github/workflow.yml - ライセンス定義ファイルを更新する - name: Update license list run: |

    # ライセンス定義ファイルの差分を更新 ./gradlew mergeReleaseLicenseList # 定義ファイルを元にjsonを更新 ./gradlew visualizeReleaseLicenseList
  8. .github/workflow.yml - ライセンス定義ファイルを更新する - name: Update license list run: |

    # ライセンス定義ファイルの差分を更新 ./gradlew mergeReleaseLicenseList # 定義ファイルを元にjsonを更新 ./gradlew visualizeReleaseLicenseList
  9. .github/workflow.yml - ライセンス定義ファイルを更新する - name: Update license list run: |

    # ライセンス定義ファイルの差分を更新 ./gradlew mergeReleaseLicenseList # 定義ファイルを元にjsonを更新 ./gradlew visualizeReleaseLicenseList
  10. .github/workflow.yml - 自動でPRを作成する - name: Create Pull Request uses: peter-evans/create-pull-request@v2

    with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commit-message: Updated license by license-list-plugin committer: syarihu <[email protected]> author: syarihu <[email protected]> title: Update license body: | This PR has been auto-generated branch: update-license-list branch-suffix: short-commit-hash
  11. .github/workflow.yml - 自動でPRを作成する - name: Create Pull Request uses: peter-evans/create-pull-request@v2

    with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commit-message: Updated license by license-list-plugin committer: syarihu <[email protected]> author: syarihu <[email protected]> title: Update license body: | This PR has been auto-generated branch: update-license-list branch-suffix: short-commit-hash
  12. .github/workflow.yml - 自動でPRを作成する - name: Create Pull Request uses: peter-evans/create-pull-request@v2

    with: token: ${{ secrets.REPO_ACCESS_TOKEN }} commit-message: Updated license by license-list-plugin committer: syarihu <[email protected]> author: syarihu <[email protected]> title: Update license body: | This PR has been auto-generated branch: update-license-list branch-suffix: short-commit-hash
  13. 参考資料 • jmatsu/license-list-plugin: Gradle plugin to manage licenses of your

    Android app's dependencies. ◦ https://github.com/jmatsu/license-list-plugin • Including Open Source Notices ◦ https://developers.google.com/android/guides/opensource • cookpad/LicenseToolsPlugin: Gradle plugin to check library licenses and generate license pages for Android ◦ https://github.com/cookpad/LicenseToolsPlugin