Skip to content

Commit 985f5aa

Browse files
committed
Update release build number
1 parent 4a90bf6 commit 985f5aa

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

.github/workflows/release.yml

+16-15
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ jobs:
5050
needs: trigger-test
5151
environment: ${{ matrix.environment }}
5252
steps:
53+
- name: '[linux] Install dependencies'
54+
if: ${{ matrix.build == 'linux' }}
55+
run: sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
56+
- name: '[appbundle] Setup java'
57+
if: ${{ matrix.build == 'appbundle' }}
58+
uses: actions/setup-java@v3
59+
with:
60+
java-version: 17
61+
distribution: temurin
62+
- name: '[appbundle] Setup android sdk'
63+
if: ${{ matrix.build == 'appbundle' }}
64+
uses: android-actions/setup-android@v3
5365
- name: Prepare flutter
5466
uses: subosito/flutter-action@v2
5567
with:
@@ -69,30 +81,19 @@ jobs:
6981
run: |
7082
echo "VERSION=$(cat VERSION)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
7183
echo "ARTIFACT_NAME=${{ matrix.build }}-sourdoc-v$(cat VERSION)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
72-
- name: '[linux] Install dependencies'
73-
if: ${{ matrix.build == 'linux' }}
74-
run: sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
75-
- name: '[appbundle] Setup java'
76-
if: ${{ matrix.build == 'appbundle' }}
77-
uses: actions/setup-java@v3
78-
with:
79-
java-version: '17'
80-
distribution: 'temurin'
81-
- name: '[appbundle] Setup android sdk'
82-
if: ${{ matrix.build == 'appbundle' }}
83-
uses: android-actions/setup-android@v3
8484
- name: '[appbundle] Setup upload keystore'
8585
if: ${{ matrix.build == 'appbundle' }}
8686
run: |
8787
echo "${{ secrets.ANDROID_UPLOAD_KEYSTORE_ASC }}" > $HOME/upload-keystore.jks.asc
8888
gpg -d --passphrase "${{ secrets.ANDROID_UPLOAD_KEYSTORE_ASC_PASSPHRASE }}" --batch $HOME/upload-keystore.jks.asc > $HOME/upload-keystore.jks
8989
echo -e "storePassword=${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}\nkeyPassword=${{ secrets.ANDROID_UPLOAD_KEYSTORE_PASSWORD }}\nkeyAlias=upload\nstoreFile=$HOME/upload-keystore.jks" > android/key.properties
9090
- name: Build release
91-
run: flutter build -v ${{ matrix.build }} --release
91+
run: BUILD_NUMBER=$(date +%s)
92+
flutter build -v ${{ matrix.build }} --release
9293
--build-name=${{ env.VERSION }}
93-
--build-number=${{ github.run_id }}
94+
--build-number=$BUILD_NUMBER
9495
--dart-define=VERSION=${{ env.VERSION }}
95-
--dart-define=BUILD_NUMBER=${{ github.run_id }}
96+
--dart-define=BUILD_NUMBER=$BUILD_NUMBER
9697
--dart-define=COMMIT_SHA=${{ github.sha }}
9798
--dart-define=REPO_URL=${{ github.server_url }}/${{ github.repository }}
9899
${{ matrix.build == 'web' && '--csp' || ''}}

lib/widgets/version_info.dart

+25-26
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ const String _actionsRunUrl =
1313
const String _openIssueUrl = '${environment.repoUrl}/issues/new/choose';
1414

1515
class VersionInfoItem extends StatelessWidget {
16-
const VersionInfoItem(
17-
{super.key,
18-
required this.linkUrl,
19-
required this.linkText,
20-
this.itemLabel});
16+
const VersionInfoItem({super.key, this.label, required this.value, this.url});
2117

22-
final String? itemLabel;
23-
final String linkUrl;
24-
final String linkText;
18+
final String? label;
19+
final String value;
20+
final String? url;
2521

2622
Future<void> _launchUrl(String url) async {
2723
if (!await launchUrl(Uri.parse(url),
@@ -34,14 +30,18 @@ class VersionInfoItem extends StatelessWidget {
3430
Widget build(BuildContext context) {
3531
return Text.rich(
3632
TextSpan(children: [
37-
if (itemLabel != null) TextSpan(text: itemLabel),
33+
if (label != null) TextSpan(text: label),
3834
TextSpan(
39-
text: linkText,
40-
style: TextStyle(color: Theme.of(context).colorScheme.primary),
41-
recognizer: TapGestureRecognizer()
42-
..onTap = () async {
43-
_launchUrl(linkUrl);
44-
})
35+
text: value,
36+
style: url != null
37+
? TextStyle(color: Theme.of(context).colorScheme.primary)
38+
: null,
39+
recognizer: url != null
40+
? (TapGestureRecognizer()
41+
..onTap = () async {
42+
_launchUrl(url!);
43+
})
44+
: null)
4545
]),
4646
textAlign: TextAlign.center,
4747
);
@@ -57,28 +57,27 @@ class VersionInfo extends StatelessWidget {
5757
Widget build(BuildContext context) {
5858
return Wrap(alignment: WrapAlignment.center, children: [
5959
VersionInfoItem(
60-
itemLabel: '©${DateTime.now().year.toString()} ${locale.title} ',
61-
linkText: 'v${environment.version}',
62-
linkUrl: _releaseUrl,
60+
label: '©${DateTime.now().year.toString()} ${locale.title} ',
61+
value: 'v${environment.version}',
62+
url: _releaseUrl,
6363
),
6464
_divider,
6565
const VersionInfoItem(
66-
itemLabel: '${locale.labelBuildNumber}: ',
67-
linkText: environment.buildNumber,
68-
linkUrl: _actionsRunUrl,
66+
label: '${locale.labelBuildNumber}: ',
67+
value: environment.buildNumber,
6968
),
7069
_divider,
7170
VersionInfoItem(
72-
itemLabel: '${locale.labelCommit}: ',
73-
linkText: environment.commitSha.length > 7
71+
label: '${locale.labelCommit}: ',
72+
value: environment.commitSha.length > 7
7473
? environment.commitSha.substring(0, 7)
7574
: environment.commitSha,
76-
linkUrl: _commitUrl,
75+
url: _commitUrl,
7776
),
7877
_divider,
7978
const VersionInfoItem(
80-
linkText: locale.reportIssue,
81-
linkUrl: _openIssueUrl,
79+
value: locale.reportIssue,
80+
url: _openIssueUrl,
8281
)
8382
]);
8483
}

0 commit comments

Comments
 (0)