From 6d039fbea7a9d224ee0c5c7964dae85ddbde5f1e Mon Sep 17 00:00:00 2001 From: ravindranag Date: Sat, 22 Apr 2023 00:35:55 +0530 Subject: [PATCH] build: github ci/cd --- .github/workflows/build_and_release.yaml | 59 ++++++++++++++++++++++++ pubspec.yaml | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_and_release.yaml diff --git a/.github/workflows/build_and_release.yaml b/.github/workflows/build_and_release.yaml new file mode 100644 index 0000000..2c796bd --- /dev/null +++ b/.github/workflows/build_and_release.yaml @@ -0,0 +1,59 @@ +name: Build and Release + +on: + push: + branches: + - main + +permissions: + contents: write + discussions: write + +jobs: + greet: + runs-on: ubuntu-latest + + steps: + - name: checkout repository + uses: actions/checkout@v3 + + - name: setup java + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: '17' + + - name: setup flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.7.10' + channel: 'stable' + + - name: setup environment + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }} + GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} + run: | + echo $KEYSTORE | base64 --decode > android/keystore.jks + echo $KEY_PROPERTIES | base64 --decode > android/key.properties + echo $GOOGLE_SERVICES | base64 --decode > android/app/google-services.json + + - name: generate changelog + id: changelog + uses: loopwerk/tag-changelog@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude_types: other,doc,chore + + - name: build apk + run: | + flutter build apk + mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/attend-75-${{github.ref_name}}.apk + +# - name: create github release +# uses: softprops/action-gh-release@v1 +# with: +# body: ${{ steps.changelog.outputs.changes }} +# files: | +# build/app/outputs/flutter-apk/attend-75-${{github.ref_name}}.apk \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 7af62f1..9ee28e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 1.1.0+1 environment: sdk: '>=2.19.6 <3.0.0'