Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 7ad952f

Browse files
committed
chore(ci): remove ability to trigger specific-platform builds
[skip ci]
1 parent c71222a commit 7ad952f

11 files changed

+88
-260
lines changed

.github/scripts/notify-embed.js

+6-29
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,20 @@
1-
const getPlatforms = () => {
2-
const platforms = [];
3-
const {
4-
ENABLE_ANDROID,
5-
ENABLE_IOS,
6-
ENABLE_LINUX,
7-
ENABLE_MACOS,
8-
ENABLE_WEB,
9-
ENABLE_WINDOWS,
10-
} = process.env;
11-
12-
if (ENABLE_ANDROID) platforms.push("Android");
13-
if (ENABLE_IOS) platforms.push("iOS");
14-
if (ENABLE_LINUX) platforms.push("Linux");
15-
if (ENABLE_MACOS) platforms.push("macOS");
16-
if (ENABLE_WEB) platforms.push("Web");
17-
if (ENABLE_WINDOWS) platforms.push("Windows");
18-
19-
if (platforms.length) return platforms.join(", ");
20-
return "None";
21-
};
22-
231
const getChangelog = () => {
24-
if (process.env.CHANGELOG) return process.env.CHANGELOG;
2+
const changelog = process.env.BUILD_CHANGELOG;
3+
if (changelog) return changelog;
254
return "No Documented Changes";
265
};
276

287
const getRelease = () => {
8+
const title = process.env.BUILD_TITLE;
299
let url = "https://builds.lunasea.app";
30-
if (process.env.BUILD_TITLE) url += `/#${process.env.BUILD_TITLE}/`;
10+
if (title) url += `/#${title}/`;
3111
return `[Download](${url})`;
3212
};
3313

3414
const getWeb = () => {
15+
const flavor = process.env.BUILD_FLAVOR;
3516
let url = "";
36-
if (process.env.FLAVOR !== "stable") url += `${process.env.FLAVOR}.`;
17+
if (flavor !== "stable") url += `${process.env.BUILD_FLAVOR}.`;
3718
url += "web.lunasea.app";
3819
return `[View Deployment](https://${url})`;
3920
};
@@ -55,10 +36,6 @@ module.exports = () => {
5536
value: getWeb(),
5637
inline: true,
5738
},
58-
{
59-
name: "Platforms",
60-
value: getPlatforms(),
61-
},
6239
{
6340
name: "Changelog",
6441
value: getChangelog(),

.github/workflows/build_web.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: 'Build Web'
33
on:
44
workflow_call:
55
inputs:
6-
build-title:
6+
build-flavor:
77
required: true
88
type: string
9-
flavor:
9+
build-title:
1010
required: true
1111
type: string
1212

@@ -75,7 +75,7 @@ jobs:
7575
outputs: type=docker,dest=${{ github.workspace}}/output/lunasea-web-docker.tar
7676
tags: |
7777
ghcr.io/jagandeepbrar/lunasea:${{ inputs.build-title }}
78-
ghcr.io/jagandeepbrar/lunasea:${{ inputs.flavor }}
78+
ghcr.io/jagandeepbrar/lunasea:${{ inputs.build-flavor }}
7979
8080
- name: Upload Artifact
8181
uses: actions/upload-artifact@v3

.github/workflows/notify.yml

+6-31
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,10 @@ on:
66
build-changelog:
77
required: true
88
type: string
9-
build-title:
10-
required: true
11-
type: string
12-
flavor:
13-
required: true
14-
type: string
15-
enable-android:
16-
required: true
17-
type: string
18-
enable-ios:
9+
build-flavor:
1910
required: true
2011
type: string
21-
enable-linux:
22-
required: true
23-
type: string
24-
enable-macos:
25-
required: true
26-
type: string
27-
enable-web:
28-
required: true
29-
type: string
30-
enable-windows:
12+
build-title:
3113
required: true
3214
type: string
3315

@@ -59,12 +41,11 @@ jobs:
5941
DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }}
6042
DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }}
6143
DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }}
62-
FLAVOR: ${{ inputs.flavor }}
44+
BUILD_FLAVOR: ${{ inputs.build-flavor }}
6345
with:
6446
result-encoding: string
6547
script: |
66-
const ref = process.env.FLAVOR || 'edge';
67-
switch (ref) {
48+
switch (process.env.BUILD_FLAVOR) {
6849
case 'beta': return process.env.DISCORD_WEBHOOK_BETA;
6950
case 'candidate': return process.env.DISCORD_WEBHOOK_CANDIDATE;
7051
case 'stable': return process.env.DISCORD_WEBHOOK_STABLE;
@@ -76,15 +57,9 @@ jobs:
7657
id: embed
7758
uses: actions/github-script@v6
7859
env:
60+
BUILD_CHANGELOG: ${{ inputs.build-changelog }}
61+
BUILD_FLAVOR: ${{ inputs.build-flavor }}
7962
BUILD_TITLE: ${{ inputs.build-title }}
80-
CHANGELOG: ${{ inputs.build-changelog }}
81-
ENABLE_ANDROID: ${{ inputs.enable-android }}
82-
ENABLE_IOS: ${{ inputs.enable-ios }}
83-
ENABLE_LINUX: ${{ inputs.enable-linux }}
84-
ENABLE_MACOS: ${{ inputs.enable-macos }}
85-
ENABLE_WEB: ${{ inputs.enable-web }}
86-
ENABLE_WINDOWS: ${{ inputs.enable-windows }}
87-
FLAVOR: ${{ inputs.flavor }}
8863
with:
8964
result-encoding: string
9065
script: return require('.github/scripts/notify-embed.js')();

.github/workflows/prepare.yml

+35-138
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
build-changelog:
1212
description: "Build Changelog"
1313
value: ${{ jobs.build-details.outputs.build-changelog }}
14+
build-flavor:
15+
description: "Build Flavor"
16+
value: ${{ jobs.build-details.outputs.build-flavor }}
1417
build-number:
1518
description: "Build Number"
1619
value: ${{ jobs.build-details.outputs.build-number }}
@@ -20,144 +23,18 @@ on:
2023
build-version:
2124
description: "Build Version"
2225
value: ${{ jobs.build-details.outputs.build-version }}
23-
enable-android:
24-
description: "Is Android Enabled?"
25-
value: ${{ jobs.platform-list.outputs.android }}
26-
enable-ios:
27-
description: "Is iOS Enabled?"
28-
value: ${{ jobs.platform-list.outputs.ios }}
29-
enable-linux:
30-
description: "Is Linux Enabled?"
31-
value: ${{ jobs.platform-list.outputs.linux }}
32-
enable-macos:
33-
description: "Is macOS Enabled?"
34-
value: ${{ jobs.platform-list.outputs.macos }}
35-
enable-windows:
36-
description: "Is Windows Enabled?"
37-
value: ${{ jobs.platform-list.outputs.windows }}
38-
enable-web:
39-
description: "Is Web Enabled?"
40-
value: ${{ jobs.platform-list.outputs.web }}
4126

4227
secrets:
4328
FIREBASE_TOKEN:
4429
required: true
4530

4631
jobs:
47-
platform-list:
48-
name: Platform List
49-
runs-on: ubuntu-latest
50-
outputs:
51-
android: ${{ steps.android.outputs.result }}
52-
ios: ${{ steps.ios.outputs.result }}
53-
linux: ${{ steps.linux.outputs.result }}
54-
macos: ${{ steps.macos.outputs.result }}
55-
windows: ${{ steps.windows.outputs.result }}
56-
web: ${{ steps.web.outputs.result }}
57-
steps:
58-
- name: Check Message for Any Keywords
59-
id: exists
60-
uses: actions/github-script@v6
61-
env:
62-
MESSAGE: ${{ github.event.head_commit.message || '' }}
63-
with:
64-
result-encoding: string
65-
script: |
66-
return process.env.MESSAGE.includes("platform:");
67-
68-
- name: Android
69-
id: android
70-
uses: actions/github-script@v6
71-
env:
72-
EXISTS: ${{ steps.exists.outputs.result }}
73-
MESSAGE: ${{ github.event.head_commit.message || '' }}
74-
with:
75-
result-encoding: string
76-
script: |
77-
if (process.env.EXISTS === "false") return true;
78-
return process.env.MESSAGE.includes("platform:android");
79-
80-
- name: iOS
81-
id: ios
82-
uses: actions/github-script@v6
83-
env:
84-
EXISTS: ${{ steps.exists.outputs.result }}
85-
MESSAGE: ${{ github.event.head_commit.message || '' }}
86-
with:
87-
result-encoding: string
88-
script: |
89-
if (process.env.EXISTS === "false") return true;
90-
return process.env.MESSAGE.includes("platform:ios");
91-
92-
- name: Linux
93-
id: linux
94-
uses: actions/github-script@v6
95-
env:
96-
EXISTS: ${{ steps.exists.outputs.result }}
97-
MESSAGE: ${{ github.event.head_commit.message || '' }}
98-
with:
99-
result-encoding: string
100-
script: |
101-
if (process.env.EXISTS === "false") return true;
102-
return process.env.MESSAGE.includes("platform:linux");
103-
104-
- name: macOS
105-
id: macos
106-
uses: actions/github-script@v6
107-
env:
108-
EXISTS: ${{ steps.exists.outputs.result }}
109-
MESSAGE: ${{ github.event.head_commit.message || '' }}
110-
with:
111-
result-encoding: string
112-
script: |
113-
if (process.env.EXISTS === "false") return true;
114-
return process.env.MESSAGE.includes("platform:macos");
115-
116-
- name: Web
117-
id: web
118-
uses: actions/github-script@v6
119-
env:
120-
EXISTS: ${{ steps.exists.outputs.result }}
121-
MESSAGE: ${{ github.event.head_commit.message || '' }}
122-
with:
123-
result-encoding: string
124-
script: |
125-
if (process.env.EXISTS === "false") return true;
126-
return process.env.MESSAGE.includes("platform:web");
127-
128-
- name: Windows
129-
id: windows
130-
uses: actions/github-script@v6
131-
env:
132-
EXISTS: ${{ steps.exists.outputs.result }}
133-
MESSAGE: ${{ github.event.head_commit.message || '' }}
134-
with:
135-
result-encoding: string
136-
script: |
137-
if (process.env.EXISTS === "false") return true;
138-
return process.env.MESSAGE.includes("platform:windows");
139-
140-
- name: Log Platform List
141-
env:
142-
android: ${{ steps.android.outputs.result }}
143-
ios: ${{ steps.ios.outputs.result }}
144-
linux: ${{ steps.linux.outputs.result }}
145-
macos: ${{ steps.macos.outputs.result }}
146-
windows: ${{ steps.windows.outputs.result }}
147-
web: ${{ steps.web.outputs.result }}
148-
run: |
149-
echo "Android: $android"
150-
echo "iOS: $ios"
151-
echo "Linux: $linux"
152-
echo "macOS: $macos"
153-
echo "Web: $web"
154-
echo "Windows: $windows"
155-
15632
build-details:
15733
name: Build Details
15834
runs-on: ubuntu-latest
15935
outputs:
16036
build-changelog: ${{ steps.build-changelog.outputs.result }}
37+
build-flavor: ${{ steps.build-flavor.outputs.result }}
16138
build-number: ${{ steps.build-number.outputs.result }}
16239
build-title: ${{ steps.build-title.outputs.output }}
16340
build-version: ${{ steps.build-version.outputs.current-version }}
@@ -179,11 +56,29 @@ jobs:
17956
MESSAGE=`git show -s --format=%s`
18057
echo "::set-output name=commit-message::$MESSAGE"
18158
59+
- name: Build Flavor
60+
id: build-flavor
61+
uses: actions/github-script@v6
62+
env:
63+
FLAVOR: ${{ inputs.flavor }}
64+
with:
65+
result-encoding: string
66+
script: |
67+
const flavor = process.env.FLAVOR;
68+
if (flavor) switch (flavor) {
69+
case 'edge':
70+
case 'beta':
71+
case 'candidate':
72+
case 'stable':
73+
return flavor;
74+
}
75+
return 'edge';
76+
18277
- name: Build Changelog
18378
id: build-changelog
18479
uses: actions/github-script@v6
18580
env:
186-
FLAVOR: ${{ inputs.flavor }}
81+
FLAVOR: ${{ steps.build-flavor.outputs.result }}
18782
MESSAGE: ${{ steps.commit-message.outputs.commit-message }}
18883
with:
18984
result-encoding: string
@@ -213,20 +108,22 @@ jobs:
213108
id: build-title
214109
run: |
215110
HASH=`git rev-parse --short ${{ github.sha }}`
216-
TITLE="v${{ steps.build-version.outputs.current-version }}-${{ inputs.flavor }}-${{ steps.build-number.outputs.result }}-$HASH"
111+
TITLE="v${{ steps.build-version.outputs.current-version }}-${{ steps.build-flavor.outputs.result }}-${{ steps.build-number.outputs.result }}-$HASH"
217112
echo "::set-output name=output::$TITLE"
218113
219114
- name: Log Build Details
220115
env:
221-
changelog: ${{ steps.build-changelog.outputs.result }}
222-
number: ${{ steps.build-number.outputs.result }}
223-
title: ${{ steps.build-title.outputs.output }}
224-
version: ${{ steps.build-version.outputs.current-version }}
116+
CHANGELOG: ${{ steps.build-changelog.outputs.result }}
117+
FLAVOR: ${{ steps.build-flavor.outputs.result }}
118+
NUMBER: ${{ steps.build-number.outputs.result }}
119+
TITLE: ${{ steps.build-title.outputs.output }}
120+
VERSION: ${{ steps.build-version.outputs.current-version }}
225121
run: |
226-
echo "Build Changelog: $changelog"
227-
echo "Build Number: $number"
228-
echo "Build Title: $title"
229-
echo "Build Version: $version"
122+
echo "Build Changelog: $CHANGELOG"
123+
echo "Build Flavor: $FLAVOR"
124+
echo "Build Number: $NUMBER"
125+
echo "Build Title: $TITLE"
126+
echo "Build Version: $VERSION"
230127
231128
generate-files:
232129
name: Generate Files
@@ -242,7 +139,7 @@ jobs:
242139

243140
- name: Generate Environment Configuration
244141
run: |
245-
export FLAVOR=${{ inputs.flavor }}
142+
export FLAVOR=${{ needs.build-details.outputs.build-flavor }}
246143
export COMMIT=${{ github.sha }}
247144
export BUILD=${{ needs.build-details.outputs.build-number }}
248145
flutter packages pub run environment_config:generate

0 commit comments

Comments
 (0)