Skip to content

Commit

Permalink
chore: use general workflows to share steps
Browse files Browse the repository at this point in the history
  • Loading branch information
adityastic committed Jun 26, 2024
1 parent 2011bb5 commit 7a7763b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
21 changes: 21 additions & 0 deletions .github/actions/common/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Common Workflow"

runs:
using: "composite"
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true

- name: Fetch Flutter Dependencies
shell: bash
run: flutter pub get

- name: Validate Code Format
shell: bash
run: dart format --output=none --set-exit-if-changed .

- name: Analyze Code
shell: bash
run: flutter analyze
22 changes: 5 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true

- name: Fetch Flutter Dependencies
run: flutter pub get

- name: Validate Code Format
run: dart format --output=none --set-exit-if-changed .

- name: Analyze Code
run: flutter analyze
- uses: ./.github/actions/common

- name: Hydrate and Update Version
id: flutter-version
run: |
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone --branch=version https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} version
cd version
Expand Down Expand Up @@ -136,8 +124,8 @@ jobs:
- name: Upload APK/AAB to apk branch
if: ${{ github.repository == 'fossasia/badgemagic-android' }}
run: |
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone --branch=apk https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk
cd apk
Expand Down

0 comments on commit 7a7763b

Please sign in to comment.