Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI workflow and add code analysis #3

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Flutter Build and Release APP

on:
push:
branches:
- main
tags:
- '*' # Trigger on all tags

jobs:
build_and_release:
name: Build, Upload, and Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.19.5

- name: Get dependencies
run: flutter pub get

- name: Analyze code
run: flutter analyze

- name: Build APK
run: flutter build apk --release # Include --release for release mode

- name: Upload APK as artifact
uses: actions/upload-artifact@v3
with:
name: android-app
path: build/app/outputs/apk/release/app-release.apk # Update path if needed

- name: Create GitHub Release (if tag)
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') # Only on tag push
env:
GITHUB_TOKEN: ${{ secrets.PAT }} # Access token with release permissions
sam-baraka marked this conversation as resolved.
Show resolved Hide resolved
with:
tag_name: ${{ github.ref }} # Use full ref to extract tag later
artifacts: /tmp/app/app-release.apk # Reference uploaded artifact
# Extract tag name from full ref
release_name: ${{ steps.extract_tag_name.outputs.tag_name }}
body: "Automatic release for tag ${{ steps.extract_tag_name.outputs.tag_name }}" # Optional release description

- name: Extract Tag Name (helper step)
id: extract_tag_name # Define an id for output access
run: |
# Regex to extract tag name from full ref (adjust if needed)
tag_name=$(echo "${{ github.ref }}" | sed 's/^refs\/tags\///')
echo "::set-output name=tag_name::$tag_name" # Set output variable
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
# fluttercon_2024
# Flutter Con Kenya 2024

A new Flutter project.
This is the official Flutter Con Kenya 2024 mobile application. The application is built using Flutter and Dart programming language. The application is designed to provide information about the conference, speakers, schedule, and sponsors. The application also provides a platform for attendees to interact with each other and the speakers.

## Getting Started

This project is a starting point for a Flutter application.
To get started with this project, you need to have Flutter installed on your machine. You can follow the instructions on the [official Flutter website](https://flutter.dev/docs/get-started/install) to install Flutter on your machine.

A few resources to get you started if this is your first Flutter project:
Once you have Flutter installed, you can clone this repository and run the following command to install the dependencies:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
```bash
flutter pub get
```

After installing the dependencies, you can run the application using the following command:

```bash
flutter run
```

This will start the application on your connected device or emulator.

## Contributing

If you would like to contribute to this project, you can fork the repository and create a new branch for your changes. Once you have made your changes, you can create a pull request to merge your changes into the main branch.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
```

### Output
```markdown
# Flutter Con Kenya 2024

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.