-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.19 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
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 "PREVIOUS_VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')" >> $GITHUB_ENV
echo "UPDATED_VERSION=$(cat pubspec.yaml | grep 'version:' | awk '{print $2}')" >> $GITHUB_ENV
- name: Restore version from cache
uses: actions/cache@v2
id: restore-cache
with:
path: version
key: ${{ runner.os }}-version-${{ hashFiles('version/*') }}
- name: Generate and save random number
run: |
echo "random_number: $RANDOM" > version.txt
echo "Updated version file:"
cat version.txt
- name: Save updated content to cache
uses: actions/cache@v2
with:
path: version
key: ${{ runner.os }}-version-${{ hashFiles('version/*') }}
# - name: Use cached version
# if: steps.cache.outputs.cache-hit == 'true'
# run: |
# echo "Using cached version: $(cat version/version.txt)"