-
Notifications
You must be signed in to change notification settings - Fork 19
155 lines (148 loc) · 4.68 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no actual publish)'
required: false
type: boolean
default: false
version:
description: 'Version to use for dry run'
required: false
type: string
default: ''
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
FLUTTER_VERSION: 3.24.3
JAVA_VERSION: "17.x"
JAVA_DISTRIBUTION: 'zulu'
jobs:
ci:
runs-on: macos-14-xlarge
if: ${{ !inputs.dry_run }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Run CI
run: bash ./scripts/run_ci_tasks.sh
release-plugin:
runs-on: ubuntu-latest
needs: [ ci]
if: ${{ !inputs.dry_run }}
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
if [[ "${{ inputs.dry_run }}" == "true" && "${{ inputs.version }}" != "" ]]; then
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
fi
- name: Get the release notes
id: get_release_notes
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
delimiter="$(openssl rand -hex 8)"
{
echo "NOTES<<${delimiter}"
awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md
echo ${delimiter}
} >> $GITHUB_OUTPUT
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: flutter pub get
- name: Github Release
if: ${{ !inputs.dry_run }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
- name: Slack Notification
uses: homoluctus/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: "Failed to release Flutter :("
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}
publish-dry-run:
needs: [ ci ]
if: ${{ inputs.dry_run }}
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
dry-run: true
working-directory: .
sdk: any
publish:
needs: [ ci ]
if: ${{ !inputs.dry_run }}
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
working-directory: .
sdk: any
release-docs:
runs-on: macos-14-xlarge
needs: [ ci, release-plugin ]
if: ${{ !inputs.dry_run }}
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
if [[ "${{ inputs.dry_run }}" == "true" && "${{ inputs.version }}" != "" ]]; then
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Setup GCP Auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Build & Package docs
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
flutter pub get
bash ./scripts/docs.sh -gp $VERSION doc/api
- name: Upload docs
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
gsutil cp doc/$VERSION.tar.gz gs://ua-web-ci-prod-docs-transfer/libraries/flutter/$VERSION.tar.gz
- name: Slack Notification
uses: homoluctus/slatify@master
with:
type: ${{ job.status }}
job_name: ":raised_hands: Airship Flutter Plugin Released! :raised_hands:"
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}