Skip to content

Commit

Permalink
added github actions scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ygit committed Sep 24, 2023
1 parent 87588fc commit 181356b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 55 deletions.
71 changes: 16 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,15 +18,18 @@ on:
- ready_for_review
branches:
- main
- develop
paths-ignore:
- "**.md"
- doc/**
- .git/
- .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
Expand All @@ -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
30 changes: 30 additions & 0 deletions .github/workflows/firstinteraction.yml
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 181356b

Please sign in to comment.