-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
Flutter_Version: 3.24.2 | ||
|
||
name: Release | ||
|
||
jobs: | ||
build-android: | ||
name: Build Android version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ env.Flutter_Version }} | ||
channel: 'stable' | ||
cache: true | ||
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}" | ||
|
||
- name: Create .env file | ||
run: | | ||
echo "" > .env | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Build Android version | ||
run: | | ||
flutter clean | ||
flutter pub get | ||
flutter pub run build_runner build --delete-conflicting-outputs | ||
flutter build apk --release --dart-define=MAPBOX_URL_TEMPLATE=${{ secrets.MAPBOX_URL_TEMPLATE }} | ||
- name: Upload Android artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ecoparking-release-android-${{ github.ref_name }} | ||
path: build/app/outputs/flutter-apk/app-release.apk | ||
|
||
build-web: | ||
name: Build Web version | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: ${{ env.Flutter_Version }} | ||
channel: 'stable' | ||
cache: true | ||
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}" | ||
|
||
- name: Create .env file | ||
run: | | ||
echo "" > .env | ||
- name: Build Web version | ||
env: | ||
FOLDER: '/release/${{ github.ref_name }}/' | ||
run: | | ||
flutter config --enable-web | ||
flutter clean | ||
flutter pub get | ||
flutter pub run build_runner build --delete-conflicting-outputs | ||
flutter build web --release --dart-define=MAPBOX_URL_TEMPLATE=${{ secrets.MAPBOX_URL_TEMPLATE }} --base-href="/${GITHUB_REPOSITORY##*/}/$FOLDER/" | ||
- name: Configure environments | ||
id: configure | ||
env: | ||
FOLDER: '/release/${{ github.ref_name }}/' | ||
run: | | ||
echo "URL=https://$GITHUB_REPOSITORY_OWNER.github.io/${GITHUB_REPOSITORY##*/}/$FOLDER" >> $GITHUB_OUTPUT | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: build/web | ||
keep_files: true | ||
destination_dir: release/${{ github.ref_name }} | ||
|
||
- name: Upload Web artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ecoparking-release-web-${{ github.ref_name }} | ||
path: build/web | ||
|
||
- name: Remove .env file | ||
run: | | ||
rm .env | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: [build-android, build-web] | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Repository Name | ||
id: set_repo_name | ||
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO_NAME: ${{ env.REPO_NAME }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: Release ${{ github.ref_name }} | ||
body: | | ||
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/CHANGELOG.md) for full changelogs. | ||
Web version is available at: https://${{ github.repository_owner }}.github.io/${{env.REPO_NAME}}/release/${{ github.ref_name }} | ||
files: | | ||
artifacts/ecoparking-release-android-${{ github.ref_name }} | ||
artifacts/ecoparking-release-web-${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## v0.0.1 - 20/10/2024 | ||
### Added | ||
- Map migration | ||
- Implement UI for book tickets flow | ||
- Config workflow for PR-preview and Release |