-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.18 KB
/
ios_distribute.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Cache Flutter App Version
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read version from pubspec.yaml
id: read-version
run: echo "::set-output name=version::$(grep 'version:' pubspec.yaml | awk '{print $2}')"
- name: Restore version from cache
id: cache
uses: actions/cache@v2
with:
path: version
key: version-${{ steps.read-version.outputs.version }}-${{ runner.os }}
- name: Check if version is cached
run: |
if [ -f version/version.txt ]; then
echo "Version is cached: $(cat version/version.txt)"
else
echo "Version is not cached"
fi
- name: Save version to cache
run: |
echo "${{ steps.read-version.outputs.version }}" > version.txt
mkdir -p version
mv version.txt version/
if: steps.cache.outputs.cache-hit != 'true'
- name: Use cached version
if: steps.cache.outputs.cache-hit == 'true'
run: |
echo "Using cached version: $(cat version/version.txt)"