-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed build workflow issue & Added create tag based on app version st…
…ep (#4) * Fixed build desktop workflow issue * create tag based on app version * Renamed workflows utils folder * revert master branch
- Loading branch information
1 parent
aa58736
commit c228a83
Showing
3 changed files
with
42 additions
and
2 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
|
||
# Enable manual run | ||
# workflow_dispatch: | ||
# inputs: | ||
|
@@ -22,13 +23,19 @@ jobs: | |
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Dart Language | ||
uses: dart-lang/[email protected] | ||
- name: Get Project Version | ||
run: "dart workflows_utils/get_project_version.dart" | ||
- name: Draft release with release notes | ||
id: create_release | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
with: | ||
tag_name: v0.0.1-beta | ||
tag_name: ${{ env.version_name }} | ||
draft: true | ||
prerelease: false | ||
generate_release_notes: true | ||
|
@@ -105,7 +112,7 @@ jobs: | |
working-directory: ${{ matrix.build_path }} | ||
- name: Compress build for macOS | ||
if: matrix.target == 'macOS' | ||
run: ditto -c -k --sequesterRsrc --keepParent eyes_care.app $GITHUB_WORKSPACE/EyesCare${{ matrix.target }}.zip | ||
run: ditto -c -k --sequesterRsrc --keepParent Eyes\ Care.app $GITHUB_WORKSPACE/EyesCare${{ matrix.target }}.zip | ||
working-directory: ${{ matrix.build_path }} | ||
- name: Compress build for Windows | ||
if: matrix.target == 'Windows' | ||
|
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,14 @@ | ||
import 'dart:io'; | ||
|
||
Future<void> setOutput(String item) async { | ||
Map<String, String> envVars = Platform.environment; | ||
String? envPath = envVars["GITHUB_ENV"]; | ||
File ghEnv = File(envPath!); | ||
String currentContent = await ghEnv.readAsString(); | ||
if (currentContent.isNotEmpty) { | ||
currentContent += "\n" "$item"; | ||
} else { | ||
currentContent = item; | ||
} | ||
ghEnv.writeAsString(currentContent); | ||
} |
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,19 @@ | ||
import 'dart:io'; | ||
|
||
import 'add_to_output.dart'; | ||
|
||
main() async { | ||
final data = File('./pubspec.yaml'); | ||
String text = data.readAsStringSync(); | ||
String currentVersion = text.substring(text.indexOf("version: ") + 9, | ||
text.indexOf("\n", text.indexOf("version: "))); | ||
String versionName = currentVersion; | ||
String versionCode = '1'; | ||
if (currentVersion.contains('+')) { | ||
versionName = currentVersion.split('+').first; | ||
versionCode = currentVersion.split('+').last; | ||
} | ||
String versionEnvVar = | ||
"version_name=${versionName.trim()}\nversion_code=${versionCode.trim()}"; | ||
await setOutput(versionEnvVar); | ||
} |