generated from lenra-io/template-javascript
-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.76 KB
/
release.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
46
47
48
49
50
51
52
53
54
55
56
name: Release
on:
push:
branches:
- main
- rc
- beta
- alpha
- "*.x"
env:
flutter_version: "3.13.0"
jobs:
get-next-version:
uses: lenra-io/github-actions/.github/workflows/get-version.yml@main
release:
needs: [get-next-version]
if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
uses: lenra-io/github-actions/.github/workflows/release.yml@main
publish:
name: publish
needs: [get-next-version, release]
if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.get-next-version.outputs.version }}
permissions:
id-token: write # Required for authentication using OIDC
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
- name: Install dependencies
run: flutter pub get
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'GCloud auth'
run: |
echo '${{ secrets.PUB_DEV_GCLOUD_KEY }}' > .github/key-file.json
gcloud auth activate-service-account --key-file=.github/key-file.json
gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev
- name: Set version
uses: mikefarah/yq@master
with:
cmd: yq -i '.version="${{ env.VERSION }}"' pubspec.yaml
- name: Publish
run: flutter pub publish --force