Skip to content

Commit

Permalink
Use env variable in workflows for get output (#86)
Browse files Browse the repository at this point in the history
* Add setOutput method

* Use setOutput method for save value

* removed unused import

* Use env keyword in workflow
  • Loading branch information
M97Chahboun authored Oct 16, 2022
1 parent 263a70a commit 2223fab
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bump-version-based-on-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:
- run: echo ${{needs.setup_dart_and_run_converter.outputs.parts}}
- run: echo ${{needs.setup_dart_and_run_converter.parts}}
- run: echo ${{needs.outputs.parts}}
- run: bundle exec fastlane bump_version push:true branch:${{ github.ref_name }} ${{needs.setup_dart_and_run_converter.outputs.parts}} bump_build:false
- run: bundle exec fastlane bump_version push:true branch:${{ github.ref_name }} ${{env.parts}} bump_build:false
working-directory: android
6 changes: 3 additions & 3 deletions .github/workflows/cd-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
promote-android:
if: ${{ (github.event.pull_request.merged == true) }}
needs: setup_dart_and_run_scripts
name: Promote Android Release from ${{needs.setup_dart_and_run_scripts.outputs.track}} to production
name: Promote Android Release from ${{env.track}} to production
runs-on: ubuntu-latest
steps:
- name: Setup Flutter
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: android

- run: bundle exec fastlane android promote from:${{needs.setup_dart_and_run_scripts.outputs.track}} to:production
- run: bundle exec fastlane android promote from:${{env.track}} to:production
working-directory: android
env:
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
Expand All @@ -112,5 +112,5 @@ jobs:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.REPO_TOKEN }}"
automatic_release_tag: "${{needs.setup_dart_and_run_scripts.outputs.project_version}}"
automatic_release_tag: "${{env.project_version}}"
prerelease: false
2 changes: 1 addition & 1 deletion .github/workflows/ci-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:

- run: bundle exec fastlane bump_version push:true branch:${{ github.ref_name }}
working-directory: android
- run: bundle exec fastlane android deploy track:${{needs.setup_dart_and_run_converter.outputs.track}}
- run: bundle exec fastlane android deploy track:${{env.track}}
working-directory: android
env:
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
10 changes: 10 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation


func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}
11 changes: 11 additions & 0 deletions macos/Flutter/ephemeral/Flutter-Generated.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/m97chahboun/Development/flutter
FLUTTER_APPLICATION_PATH=/Users/m97chahboun/Development/flutter_ci_cd
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=2.2.8
FLUTTER_BUILD_NUMBER=18
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.dart_tool/package_config.json
12 changes: 12 additions & 0 deletions macos/Flutter/ephemeral/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/m97chahboun/Development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/m97chahboun/Development/flutter_ci_cd"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=2.2.8"
export "FLUTTER_BUILD_NUMBER=18"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
Empty file added tst.txt
Empty file.
2 changes: 1 addition & 1 deletion workflows_utils/add_to_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:io';

Future<void> setOutput(String item) async {
Map<String, String> envVars = Platform.environment;
String? envPath = envVars["GITHUB_OUTPUT"];
String? envPath = envVars["GITHUB_ENV"];
File ghEnv = File(envPath!);
String currentContent = await ghEnv.readAsString();
if (currentContent.isNotEmpty) {
Expand Down

0 comments on commit 2223fab

Please sign in to comment.