diff --git a/.czrc b/.czrc index 59a7c140..9ab2e392 100644 --- a/.czrc +++ b/.czrc @@ -10,11 +10,11 @@ "title": "Documentation" }, "feat": { - "description": "A new feature", + "description": "A code change that implements a new feature", "title": "Feature" }, "fix": { - "description": "A bug fix", + "description": "A code change that implements a bug fix", "title": "Fix" }, "refactor": { diff --git a/.github/workflows/build_all_platforms.yml b/.github/workflows/build_all_platforms.yml deleted file mode 100644 index 59f00a3a..00000000 --- a/.github/workflows/build_all_platforms.yml +++ /dev/null @@ -1,425 +0,0 @@ -name: '[Build] All Platforms' - -on: - workflow_call: - inputs: - FLAVOR: - required: true - type: string - VERSION: - required: true - type: string - - secrets: - APPLE_ID: - required: true - APPLE_ITC_TEAM_ID: - required: true - APPLE_STORE_CONNECT_ISSUER_ID: - required: true - APPLE_STORE_CONNECT_KEY: - required: true - APPLE_STORE_CONNECT_KEY_FILEPATH: - required: true - APPLE_STORE_CONNECT_KEY_ID: - required: true - APPLE_TEAM_ID: - required: true - DISCORD_WEBHOOK: - required: true - GOOGLE_PLAY_API: - required: true - GOOGLE_SERVICE_INFO_PLIST: - required: true - GOOGLE_SERVICES_JSON: - required: true - KEY_JKS: - required: true - KEY_PROPERTIES: - required: true - MATCH_KEYCHAIN_NAME: - required: true - MATCH_KEYCHAIN_PASSWORD: - required: true - MATCH_PASSWORD: - required: true - MATCH_SSH_PRIVATE_KEY: - required: true - -jobs: - build_android: - name: Build Android - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Set Flavor - working-directory: ${{ github.workspace }} - run: | - echo $'FLAVOR=${{ inputs.FLAVOR }}\nCOMMIT=${{ github.sha }}' > .flavor - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.GOOGLE_SERVICES_JSON }} | base64 --decode > android/app/google-services.json - echo ${{ secrets.KEY_JKS }} | base64 --decode > android/key.jks - echo ${{ secrets.KEY_PROPERTIES }} | base64 --decode > android/key.properties - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install Java - uses: actions/setup-java@v2 - with: - distribution: zulu - java-version: 11 - - - name: Install Flutter - uses: subosito/flutter-action@v2 - with: - channel: beta - cache: true - - - name: Setup Flutter - working-directory: ${{ github.workspace }} - run: | - flutter pub get - flutter packages pub run build_runner build - - - name: Run Fastlane - working-directory: ${{ github.workspace }}/android - env: - SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json - run: | - bundle install - bundle exec fastlane build - - - name: Upload App Bundle Artifact - uses: actions/upload-artifact@v2 - with: - name: android-${{ inputs.VERSION }} - path: ${{ github.workspace }}/build/app/outputs/bundle/release/app-release.aab - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: android-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` Android Build' - - build_ios: - name: Build iOS - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Set Flavor - working-directory: ${{ github.workspace }} - run: | - echo $'FLAVOR=${{ inputs.FLAVOR }}\nCOMMIT=${{ github.sha }}' > .flavor - - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > ios/GoogleService-Info.plist - - - name: Setup SSH Agent - uses: webfactory/ssh-agent@v0.5.4 - with: - ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install Flutter - uses: subosito/flutter-action@v2 - with: - channel: beta - cache: true - - - name: Setup Flutter - working-directory: ${{ github.workspace }} - run: | - flutter pub get - flutter packages pub run build_runner build - - - name: Install Pods - working-directory: ${{ github.workspace }}/ios - run: | - pod install --repo-update - - - name: Run Fastlane - working-directory: ${{ github.workspace }}/ios - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - run: | - bundle install - bundle exec fastlane build - - - name: Upload App Package Artifact - uses: actions/upload-artifact@v2 - with: - name: ios-${{ inputs.VERSION }} - path: ${{ github.workspace }}/ios/Runner.ipa - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: ios-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` iOS Build' - - build_macos: - name: Build macOS - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Set Flavor - working-directory: ${{ github.workspace }} - run: | - echo $'FLAVOR=${{ inputs.FLAVOR }}\nCOMMIT=${{ github.sha }}' > .flavor - - - name: Select Xcode Version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > macos/GoogleService-Info.plist - - - name: Setup SSH Agent - uses: webfactory/ssh-agent@v0.5.4 - with: - ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Install Flutter - uses: subosito/flutter-action@v2 - with: - channel: beta - cache: true - - - name: Setup Flutter - working-directory: ${{ github.workspace }} - run: | - flutter config --enable-macos-desktop - flutter pub get - flutter packages pub run build_runner build - - - name: Install Pods - working-directory: ${{ github.workspace }}/macos - run: | - pod install --repo-update - - - name: Run Fastlane - working-directory: ${{ github.workspace }}/macos - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - run: | - bundle install - bundle exec fastlane build - - - name: Upload App Package Artifact - uses: actions/upload-artifact@v2 - with: - name: macos-${{ inputs.VERSION }} - path: ${{ github.workspace }}/macos/LunaSea.pkg - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: macos-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` macOS Build' - - deploy_android: - name: Deploy Android - needs: build_android - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Download App Bundle Artifact - uses: actions/download-artifact@v2 - with: - name: android-${{ inputs.VERSION }} - path: ${{ github.workspace }} - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.GOOGLE_PLAY_API }} | base64 --decode > .fastlane-android-auth.json - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy to Google Play Store - working-directory: ${{ github.workspace }}/android - env: - SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json - run: | - bundle install - bundle exec fastlane deploy track:${{ inputs.FLAVOR }} aab:${{ github.workspace }}/app-release.aab version_name:${{ github.sha }} - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: android-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` Android Deployment' - - deploy_ios: - name: Deploy iOS - needs: build_ios - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Download App Package Artifact - uses: actions/download-artifact@v2 - with: - name: ios-${{ inputs.VERSION }} - path: ${{ github.workspace }} - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > ios/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy to App Store Connect - working-directory: ${{ github.workspace }}/ios - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - run: | - bundle install - bundle exec fastlane deploy groups:${{ inputs.FLAVOR }} ipa:${{ github.workspace }}/Runner.ipa - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: ios-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` iOS Deployment' - - deploy_macos: - name: Deploy macOS - needs: build_macos - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - - name: Download App Package Artifact - uses: actions/download-artifact@v2 - with: - name: macos-${{ inputs.VERSION }} - path: ${{ github.workspace }} - - - name: Install Secret Keys - working-directory: ${{ github.workspace }} - run: | - echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > macos/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - - name: Deploy to App Store Connect - working-directory: ${{ github.workspace }}/macos - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - run: | - bundle install - bundle exec fastlane deploy groups:${{ inputs.FLAVOR }} pkg:${{ github.workspace }}/LunaSea.pkg - - - name: Send Discord Message - uses: sarisia/actions-status-discord@v1 - if: always() - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - description: macos-${{ inputs.VERSION }} - title: '`[${{ inputs.FLAVOR}}]` macOS Deployment' diff --git a/.github/workflows/generate_files.yml b/.github/workflows/generate_files.yml new file mode 100644 index 00000000..049dc324 --- /dev/null +++ b/.github/workflows/generate_files.yml @@ -0,0 +1,58 @@ +name: Generate Files + +on: + workflow_call + +jobs: + runner: + name: Build Runner + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download Flavor Configuration + uses: actions/upload-artifact@v2 + with: + name: flavor-${{ github.sha }} + path: ${{ github.workspace }} + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: beta + cache: true + + - name: Generate + working-directory: ${{ github.workspace }} + run: | + flutter pub get + flutter packages pub run build_runner build + + - name: Upload Source Files + uses: actions/upload-artifact@v2 + with: + name: lib-${{ github.sha }} + path: ${{ github.workspace }}/lib + + localization: + name: Localization + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + + - name: Generate + working-directory: ${{ github.workspace }} + run: | + dart pub global activate derry + derry generate localization + + - name: Upload Localization Files + uses: actions/upload-artifact@v2 + with: + name: localization-${{ github.sha }} + path: ${{ github.workspace }}/assets/localization diff --git a/.github/workflows/github_issues.yml b/.github/workflows/github_issues.yml new file mode 100644 index 00000000..00f6dbb8 --- /dev/null +++ b/.github/workflows/github_issues.yml @@ -0,0 +1,45 @@ +name: '[GitHub] Issues' + +on: + issues: + types: [labeled, unlabeled, reopened] + +jobs: + support: + runs-on: ubuntu-latest + steps: + - name: Feature Request + uses: dessant/support-requests@v2 + with: + github-token: ${{ github.token }} + support-label: 'feature request' + issue-comment: > + Hi @{issue-author}! We use the issue tracker exclusively + for bug reports and issues. However, this issue appears + to be a feature request. Please use the following channels: + + - [Feedback & Feature Requests Board](https://feedback.lunasea.app) + + - [Discord](https://www.lunasea.app/discord) + close-issue: true + lock-issue: true + issue-lock-reason: 'off-topic' + + - name: Support + uses: dessant/support-requests@v2 + with: + github-token: ${{ github.token }} + support-label: 'support' + issue-comment: > + Hi @{issue-author}! We use the issue tracker exclusively + for bug reports and issues. However, this issue appears + to be a support request. Please use the following channels: + + - [Discord](https://www.lunasea.app/discord) + + - [GitHub Discussions](https://github.com/CometTools/LunaSea/discussions) + + - [Subreddit](https://www.lunasea.app/reddit) + close-issue: true + lock-issue: true + issue-lock-reason: 'off-topic' diff --git a/.github/workflows/github_issues_feature_request.yml b/.github/workflows/github_issues_feature_request.yml deleted file mode 100644 index 9c48cd28..00000000 --- a/.github/workflows/github_issues_feature_request.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: '[GitHub] Issues - Feature Requests' - -on: - issues: - types: [labeled, unlabeled, reopened] - -jobs: - support: - runs-on: ubuntu-20.04 - steps: - - uses: dessant/support-requests@v2 - with: - github-token: ${{ github.token }} - support-label: 'feature request' - issue-comment: > - Hi @{issue-author}! We use the issue tracker exclusively - for bug reports and issues. However, this issue appears - to be a feature request. Please use the following channels: - - - [Feedback & Feature Requests Board](https://feedback.lunasea.app) - - - [Discord](https://www.lunasea.app/discord) - close-issue: true - lock-issue: true - issue-lock-reason: 'off-topic' diff --git a/.github/workflows/github_issues_support.yml b/.github/workflows/github_issues_support.yml deleted file mode 100644 index fa4c07ac..00000000 --- a/.github/workflows/github_issues_support.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: '[GitHub] Issues - Support' - -on: - issues: - types: [labeled, unlabeled, reopened] - -jobs: - support: - runs-on: ubuntu-20.04 - steps: - - uses: dessant/support-requests@v2 - with: - github-token: ${{ github.token }} - support-label: 'support' - issue-comment: > - Hi @{issue-author}! We use the issue tracker exclusively - for bug reports and issues. However, this issue appears - to be a support request. Please use the following channels: - - - [Discord](https://www.lunasea.app/discord) - - - [GitHub Discussions](https://github.com/CometTools/LunaSea/discussions) - - - [Subreddit](https://www.lunasea.app/reddit) - close-issue: true - lock-issue: true - issue-lock-reason: 'off-topic' diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml new file mode 100644 index 00000000..a34a48e8 --- /dev/null +++ b/.github/workflows/prepare.yml @@ -0,0 +1,30 @@ +name: Prepare + +on: + workflow_call: + outputs: + flavor: + description: "Build flavor" + value: ${{ jobs.flavor.outputs.output1 }} + +jobs: + flavor: + name: Flavor + runs-on: ubuntu-latest + outputs: + output1: ${{ steps.flavor.outputs.flavor }} + steps: + - name: Set Flavor Output + id: flavor + run: echo "::set-output name=flavor::internal" + + - name: Create Flavor Configuration + working-directory: ${{ github.workspace }} + run: | + echo $'FLAVOR=${{ steps.flavor.outputs.flavor }}\nCOMMIT=${{ github.sha }}' > .flavor + + - name: Upload Flavor Configuration + uses: actions/upload-artifact@v2 + with: + name: flavor-${{ github.sha }} + path: ${{ github.workspace }}/.flavor diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c2211122 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,86 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + cancel: + name: Cancel Previous Runs + runs-on: ubuntu-latest + steps: + - name: Cancel Workflow Action + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + prepare: + name: Prepare + needs: [ cancel ] + uses: CometTools/LunaSea/.github/workflows/prepare.yml@master + + generate_files: + name: Generate + needs: [ prepare ] + uses: CometTools/LunaSea/.github/workflows/generate_files.yml@master + + validate: + name: Validate + needs: [ generate_files ] + uses: CometTools/LunaSea/.github/workflows/validate.yml@master + + android: + name: Android + needs: [ prepare, validate ] + uses: CometTools/LunaSea/.github/workflows/release_android.yml@master + with: + flavor: ${{ needs.prepare.outputs.flavor }} + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} + GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} + KEY_JKS: ${{ secrets.KEY_JKS }} + KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} + + ios: + name: iOS + needs: [ prepare, validate ] + uses: CometTools/LunaSea/.github/workflows/release_ios.yml@master + with: + flavor: ${{ needs.prepare.outputs.flavor }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} + + macos: + name: macOS + needs: [ prepare, validate ] + uses: CometTools/LunaSea/.github/workflows/release_macos.yml@master + with: + flavor: ${{ needs.prepare.outputs.flavor }} + secrets: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/release_alpha.yml b/.github/workflows/release_alpha.yml deleted file mode 100644 index a416c149..00000000 --- a/.github/workflows/release_alpha.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: '[Release] Alpha' - -on: - push: - tags: - - alpha - -jobs: - cancel: - name: Cancel Previous Runs - runs-on: ubuntu-latest - steps: - - name: Cancel Workflow Action - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - build: - name: Alpha Release - uses: CometTools/LunaSea/.github/workflows/build_all_platforms.yml@master - needs: cancel - with: - FLAVOR: alpha - VERSION: alpha-${{ github.sha }} - secrets: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} - GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} - GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} - KEY_JKS: ${{ secrets.KEY_JKS }} - KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/release_android.yml b/.github/workflows/release_android.yml new file mode 100644 index 00000000..106e3bcf --- /dev/null +++ b/.github/workflows/release_android.yml @@ -0,0 +1,135 @@ +name: '[Release] Android' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + + secrets: + DISCORD_WEBHOOK: + required: true + GOOGLE_PLAY_API: + required: true + GOOGLE_SERVICES_JSON: + required: true + KEY_JKS: + required: true + KEY_PROPERTIES: + required: true + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download Source Files + uses: actions/download-artifact@v2 + with: + name: lib-${{ github.sha }} + path: ${{ github.workspace }}/lib + + - name: Download Localization Files + uses: actions/download-artifact@v2 + with: + name: localization-${{ github.sha }} + path: ${{ github.workspace }}/assets/localization + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.GOOGLE_SERVICES_JSON }} | base64 --decode > android/app/google-services.json + echo ${{ secrets.KEY_JKS }} | base64 --decode > android/key.jks + echo ${{ secrets.KEY_PROPERTIES }} | base64 --decode > android/key.properties + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Install Java + uses: actions/setup-java@v2 + with: + distribution: zulu + java-version: 11 + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: beta + cache: true + + - name: Setup Flutter + working-directory: ${{ github.workspace }} + run: | + flutter pub get + + - name: Run Fastlane + working-directory: ${{ github.workspace }}/android + env: + SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json + run: | + bundle install + bundle exec fastlane build + + - name: Upload App Bundle Artifact + uses: actions/upload-artifact@v2 + with: + name: android-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }}/build/app/outputs/bundle/release/app-release.aab + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` Android Build' + description: android-${{ inputs.flavor }}-${{ github.sha }} + + deploy: + name: Deploy + runs-on: ubuntu-latest + needs: [ build ] + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download App Package Artifact + uses: actions/download-artifact@v2 + with: + name: android-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.GOOGLE_PLAY_API }} | base64 --decode > .fastlane-android-auth.json + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Deploy to Google Play Store + working-directory: ${{ github.workspace }}/android + env: + SUPPLY_JSON_KEY: ${{ github.workspace }}/.fastlane-android-auth.json + run: | + bundle install + bundle exec fastlane deploy track:${{ inputs.flavor }} aab:${{ github.workspace }}/app-release.aab version_name:${{ github.sha }} + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` Android Deployment' + description: android-${{ inputs.flavor }}-${{ github.sha }} diff --git a/.github/workflows/release_beta.yml b/.github/workflows/release_beta.yml deleted file mode 100644 index b2edb9bf..00000000 --- a/.github/workflows/release_beta.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: '[Release] Beta' - -on: - push: - tags: - - beta - -jobs: - cancel: - name: Cancel Previous Runs - runs-on: ubuntu-latest - steps: - - name: Cancel Workflow Action - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - build: - name: Beta Release - uses: CometTools/LunaSea/.github/workflows/build_all_platforms.yml@master - needs: cancel - with: - FLAVOR: beta - VERSION: beta-${{ github.sha }} - secrets: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} - GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} - GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} - KEY_JKS: ${{ secrets.KEY_JKS }} - KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/release_develop.yml b/.github/workflows/release_develop.yml deleted file mode 100644 index 3a7fda78..00000000 --- a/.github/workflows/release_develop.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: '[Release] Develop' - -on: - push: - branches: - - master - -jobs: - cancel: - name: Cancel Previous Runs - runs-on: ubuntu-latest - steps: - - name: Cancel Workflow Action - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - build: - name: Develop Release - uses: CometTools/LunaSea/.github/workflows/build_all_platforms.yml@master - needs: cancel - with: - FLAVOR: internal - VERSION: internal-${{ github.sha }} - secrets: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} - APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }} - APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} - APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} - APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }} - GOOGLE_SERVICE_INFO_PLIST: ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} - GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} - KEY_JKS: ${{ secrets.KEY_JKS }} - KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} - MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} - MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/release_ios.yml b/.github/workflows/release_ios.yml new file mode 100644 index 00000000..6a257479 --- /dev/null +++ b/.github/workflows/release_ios.yml @@ -0,0 +1,168 @@ +name: '[Release] iOS' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + + secrets: + APPLE_ID: + required: true + APPLE_ITC_TEAM_ID: + required: true + APPLE_STORE_CONNECT_ISSUER_ID: + required: true + APPLE_STORE_CONNECT_KEY: + required: true + APPLE_STORE_CONNECT_KEY_FILEPATH: + required: true + APPLE_STORE_CONNECT_KEY_ID: + required: true + APPLE_TEAM_ID: + required: true + DISCORD_WEBHOOK: + required: true + GOOGLE_SERVICE_INFO_PLIST: + required: true + MATCH_KEYCHAIN_NAME: + required: true + MATCH_KEYCHAIN_PASSWORD: + required: true + MATCH_PASSWORD: + required: true + MATCH_SSH_PRIVATE_KEY: + required: true + +jobs: + build: + name: Build + runs-on: macos-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download Source Files + uses: actions/download-artifact@v2 + with: + name: lib-${{ github.sha }} + path: ${{ github.workspace }}/lib + + - name: Download Localization Files + uses: actions/download-artifact@v2 + with: + name: localization-${{ github.sha }} + path: ${{ github.workspace }}/assets/localization + + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > ios/GoogleService-Info.plist + + - name: Setup SSH Agent + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: beta + cache: true + + - name: Setup Flutter + working-directory: ${{ github.workspace }} + run: | + flutter pub get + + - name: Install Pods + working-directory: ${{ github.workspace }}/ios + run: | + pod install --repo-update + + - name: Run Fastlane + working-directory: ${{ github.workspace }}/ios + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + run: | + bundle install + bundle exec fastlane build + + - name: Upload App Package Artifact + uses: actions/upload-artifact@v2 + with: + name: ios-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }}/ios/Runner.ipa + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` iOS Build' + description: ios-${{ inputs.flavor }}-${{ github.sha }} + + deploy: + name: Deploy + runs-on: macos-latest + needs: [ build ] + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download App Package Artifact + uses: actions/download-artifact@v2 + with: + name: ios-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > ios/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Deploy to App Store Connect + working-directory: ${{ github.workspace }}/ios + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + run: | + bundle install + bundle exec fastlane deploy groups:${{ inputs.flavor }} ipa:${{ github.workspace }}/Runner.ipa + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` Android Deployment' + description: android-${{ inputs.flavor }}-${{ github.sha }} diff --git a/.github/workflows/release_macos.yml b/.github/workflows/release_macos.yml new file mode 100644 index 00000000..0c93f091 --- /dev/null +++ b/.github/workflows/release_macos.yml @@ -0,0 +1,169 @@ +name: '[Release] macOS' + +on: + workflow_call: + inputs: + flavor: + required: true + type: string + + secrets: + APPLE_ID: + required: true + APPLE_ITC_TEAM_ID: + required: true + APPLE_STORE_CONNECT_ISSUER_ID: + required: true + APPLE_STORE_CONNECT_KEY: + required: true + APPLE_STORE_CONNECT_KEY_FILEPATH: + required: true + APPLE_STORE_CONNECT_KEY_ID: + required: true + APPLE_TEAM_ID: + required: true + DISCORD_WEBHOOK: + required: true + GOOGLE_SERVICE_INFO_PLIST: + required: true + MATCH_KEYCHAIN_NAME: + required: true + MATCH_KEYCHAIN_PASSWORD: + required: true + MATCH_PASSWORD: + required: true + MATCH_SSH_PRIVATE_KEY: + required: true + +jobs: + build: + name: Build + runs-on: macos-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Download Source Files + uses: actions/download-artifact@v2 + with: + name: lib-${{ github.sha }} + path: ${{ github.workspace }}/lib + + - name: Download Localization Files + uses: actions/download-artifact@v2 + with: + name: localization-${{ github.sha }} + path: ${{ github.workspace }}/assets/localization + + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} | base64 --decode > macos/GoogleService-Info.plist + + - name: Setup SSH Agent + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: beta + cache: true + + - name: Setup Flutter + working-directory: ${{ github.workspace }} + run: | + flutter config --enable-macos-desktop + flutter pub get + + - name: Install Pods + working-directory: ${{ github.workspace }}/macos + run: | + pod install --repo-update + + - name: Run Fastlane + working-directory: ${{ github.workspace }}/macos + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} + MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + run: | + bundle install + bundle exec fastlane build + + - name: Upload App Package Artifact + uses: actions/upload-artifact@v2 + with: + name: macos-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }}/macos/LunaSea.pkg + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` macOS Build' + description: macos-${{ inputs.flavor }}-${{ github.sha }} + + deploy: + name: Deploy + runs-on: macos-latest + needs: [ build ] + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download App Package Artifact + uses: actions/download-artifact@v2 + with: + name: macos-${{ inputs.flavor }}-${{ github.sha }} + path: ${{ github.workspace }} + + - name: Install Secret Keys + working-directory: ${{ github.workspace }} + run: | + echo ${{ secrets.APPLE_STORE_CONNECT_KEY }} | base64 --decode > macos/${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Deploy to App Store Connect + working-directory: ${{ github.workspace }}/macos + env: + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }} + APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }} + APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ secrets.APPLE_STORE_CONNECT_KEY_FILEPATH }} + APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + run: | + bundle install + bundle exec fastlane deploy groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/LunaSea.pkg + + - name: Send Discord Message + uses: sarisia/actions-status-discord@v1 + if: always() + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + title: '`[${{ inputs.flavor }}]` macOS Deployment' + description: macos-${{ inputs.flavor }}-${{ github.sha }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..4adaa389 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,34 @@ +name: Validate + +on: + workflow_call + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download Source Files + uses: actions/download-artifact@v2 + with: + name: lib-${{ github.sha }} + path: ${{ github.workspace }}/lib + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: beta + cache: true + + - name: Setup Flutter + working-directory: ${{ github.workspace }} + run: | + flutter pub get + + - name: Analyze + uses: zgosalvez/github-actions-analyze-dart@v1 + with: + fail-on-warnings: true diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..76fd734a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "yaml.schemas": { + "https://json.schemastore.org/github-workflow.json": "file:///Users/jagandeepbrar/Git/LunaSea/.github/workflows/deploy.yml" + } +}