From 181356b9dad6c5f1aae76210fb5767297945c233 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Sun, 24 Sep 2023 13:39:06 +0530 Subject: [PATCH] added github actions scripts --- .github/workflows/build.yml | 71 ++++++-------------------- .github/workflows/firstinteraction.yml | 30 +++++++++++ .github/workflows/stale.yml | 20 ++++++++ 3 files changed, 66 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/firstinteraction.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76acc2e0d..cdf7befd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,15 @@ -name: Deploy UAT Apps +name: Build Android Appbundle concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true on: + workflow_dispatch: push: - branches: [main, develop] + branches: + - main + - develop pull_request: types: - opened @@ -15,6 +18,7 @@ on: - ready_for_review branches: - main + - develop paths-ignore: - "**.md" - doc/** @@ -22,8 +26,10 @@ on: - .vscode/ jobs: - build_with_signing: - runs-on: macos-latest + build_appbundle: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + timeout-minutes: 30 steps: - name: Checkout repository @@ -32,58 +38,13 @@ jobs: with: distribution: zulu java-version: 12.x - # 10 + - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 with: - # 11 channel: stable - - name: Set Environmnent Variables - env: - FLUTTER_HMS_JSON: ${{ secrets.FLUTTER_HMS_JSON }} - # BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} - # P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - # FLUTTERADHOCDISTRIBUTION: ${{ secrets.FLUTTERADHOCDISTRIBUTION }} - # FLUTTERADHOCBROADCASTUPLOADEXTENSION: ${{ secrets.FLUTTERADHOCBROADCASTUPLOADEXTENSION }} - # FLUTTERAPPSTORE: ${{ secrets.FLUTTERAPPSTORE }} - # FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION: ${{ secrets.FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION }} - # KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - # SLACK_URL: ${{ secrets.SLACK_URL }} - run: | - echo "Setting Environmnent Variables" - echo "FLUTTER_HMS_JSON: $FLUTTER_HMS_JSON" - - # create variables - # CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - # PP_PATH_FLUTTERADHOCDISTRIBUTION=$RUNNER_TEMP/FLUTTERADHOCDISTRIBUTION.mobileprovision - # PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION=$RUNNER_TEMP/FLUTTERADHOCBROADCASTUPLOADEXTENSION.mobileprovision - # PP_PATH_FLUTTERAPPSTORE=$RUNNER_TEMP/FLUTTERAPPSTORE.mobileprovision - # PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION=$RUNNER_TEMP/FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION.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 - # echo -n "$FLUTTERADHOCDISTRIBUTION" | base64 --decode -o $PP_PATH_FLUTTERADHOCDISTRIBUTION - # echo -n "$FLUTTERADHOCBROADCASTUPLOADEXTENSION" | base64 --decode -o $PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION - # echo -n "$FLUTTERAPPSTORE" | base64 --decode -o $PP_PATH_FLUTTERAPPSTORE - # echo -n "$FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION" | base64 --decode -o $PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION - - # # 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 list-keychain -d user -s $KEYCHAIN_PATH - - # # apply provisioning profile - # mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PATH_FLUTTERADHOCDISTRIBUTION ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PATH_FLUTTERADHOCBROADCASTUPLOADEXTENSION ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PATH_FLUTTERAPPSTORE ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PATH_FLUTTERAPPSTOREBROADCASTUPLOADEXTENSION ~/Library/MobileDevice/Provisioning\ Profiles - - name: Run Release Apps Script + cache: true + - name: Build Android App Bundle run: | - chmod +x ./release-apps.sh - ./release-apps.sh - shell: bash + cd packages/hmssdk_flutter/example + flutter build appbundle --debug -t lib/main.dart + shell: bash \ No newline at end of file diff --git a/.github/workflows/firstinteraction.yml b/.github/workflows/firstinteraction.yml new file mode 100644 index 000000000..118b2953a --- /dev/null +++ b/.github/workflows/firstinteraction.yml @@ -0,0 +1,30 @@ +name: first-interaction + +on: + workflow_dispatch: + issues: + types: [opened] + pull_request: + branches: + - main + - develop + types: [opened] + +jobs: + check_for_first_interaction: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/first-interaction@main + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: | + Hello! Thank you for filing an issue. + + Please include relevant logs or detailed description for faster resolutions. + pr-message: | + Hello! Thank you for your contribution. + + If you are fixing a bug, please reference the issue number in the description. + + If you are implementing a feature request, please check with the maintainers that the feature will be accepted first. \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..a42fecfc0 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,20 @@ +name: 'Close stale issues and PRs' +on: + workflow_dispatch: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' + stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' + close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.' + days-before-issue-stale: 30 + days-before-pr-stale: 45 + days-before-issue-close: 5 + days-before-pr-close: 10 \ No newline at end of file