-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from GDSCParulUniversity/12-quality-create-a-r…
…elease-upload-mechanism 12 quality create a release upload mechanism
- Loading branch information
Showing
6 changed files
with
132 additions
and
203 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,3 @@ | ||
FROM ghcr.io/gdscparuluniversity/flutterdevcontainer:latest | ||
|
||
ENV DEVCONTAINER="true" |
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,26 @@ | ||
{ | ||
"name": "Ubuntu", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 | ||
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. | ||
"args": { "VARIANT": "ubuntu-22.04" } | ||
}, | ||
|
||
"extensions": [ | ||
"Dart-Code.flutter", | ||
"alexisvt.flutter-snippets", | ||
"lizebang.bash-extension-pack", | ||
"shakram02.bash-beautify" | ||
], | ||
|
||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
|
||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
repo_link="https://github.com/GDSCParulUniversity/Habit-Tracker-App" | ||
|
||
current_verision=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ | ||
$repo_link | tail -n1 | cut -d / -f 3 | cut -d V -f 2-) | ||
|
||
[[ -z $current_verision ]] && { | ||
echo "NO release found?" | ||
echo "Fallback to V0000" | ||
current_verision=00 | ||
} | ||
|
||
new_release="V$(($current_verision + 1))" | ||
echo "VERSIONTAG=$new_release" |
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
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,67 @@ | ||
name: Habit Tracker App CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
jobs: | ||
flutter_build: | ||
name: Run flutter build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: "12.x" | ||
- uses: subosito/flutter-action@v2.6.1 | ||
- name: "Flutter clean | get | build" | ||
run: | | ||
flutter pub get | ||
flutter clean | ||
flutter build apk --release | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: release-apk | ||
path: build/app/outputs/flutter-apk/app-release.apk | ||
|
||
- name: Compute release tag | ||
run: | | ||
repo_link="https://github.com/GDSCParulUniversity/Habit-Tracker-App" | ||
current_verision=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ | ||
$repo_link | tail -n1 | cut -d / -f 3 | cut -d V -f 2-) | ||
[[ -z $current_verision ]] && { | ||
echo "NO release found?" | ||
echo "Fallback to V0" | ||
current_verision=0 | ||
} | ||
new_release="V$(($current_verision + 1))" | ||
echo "VERSIONTAG=$new_release" >> $GITHUB_ENV | ||
- name: Generate release notes | ||
run: | | ||
echo "Habit Tracker ${VERSIONTAG}" > release.md | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.VERSIONTAG }} | ||
release_name: ${{ env.VERSIONTAG }} | ||
body_path: release.md | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload assets | ||
run: | | ||
set -x | ||
sleep 10 | ||
hub release edit -F release.md -a build/app/outputs/flutter-apk/app-release.apk -m "$VERSIONTAG" "$VERSIONTAG" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.