Skip to content

Commit 8caa11b

Browse files
committed
feat:added noping cutombuild [noPing] [build.apk] [build.windows]
1 parent 03304b0 commit 8caa11b

File tree

2 files changed

+97
-53
lines changed

2 files changed

+97
-53
lines changed

.github/workflows/customBuild.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: customBuild
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_android:
10+
runs-on: ubuntu-latest
11+
if: contains(github.event.head_commit.message, '[build.apk]')
12+
permissions:
13+
contents: write
14+
pull-requests: read
15+
actions: read
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-java@v4
23+
with:
24+
distribution: 'oracle'
25+
java-version: '17'
26+
- name: Setup Flutter
27+
uses: subosito/flutter-action@v2
28+
with:
29+
flutter-version: 3.24.1
30+
- run: flutter pub get
31+
- run: flutter build apk
32+
- run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
33+
- name: Upload File To Google Drive
34+
id: gdriveUpload
35+
uses: hoatruongdev09/google-drive-file-upload-github-action@v1.1
36+
with:
37+
file-path: build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
38+
upload-name: Dartotsu.apk
39+
upload-to-folder-id: 1nWYex54zd58SVitJUCva91_4k1PPTdP3
40+
service-account-json: "${{secrets.GOOGLE_KEY}}"
41+
overrwrite: true
42+
- name: Send Download link to discord after Build
43+
id: dealing
44+
run: |
45+
curl -H "Content-Type: application/json" \
46+
-d '{"content": "A new apk is here check it out: [Dartotsu](${{steps.gdriveUpload.outputs.web-content-link}})"}' \
47+
${{ secrets.DISCORD_WEBHOOK_URL }}
48+
build_windows:
49+
runs-on: windows-latest
50+
if: contains(github.event.head_commit.message, '[build.windows]')
51+
permissions:
52+
contents: write
53+
pull-requests: write
54+
repository-projects: write
55+
steps:
56+
- name: Cloing repository
57+
uses: actions/checkout@v4
58+
- name: Setup Flutter
59+
uses: subosito/flutter-action@v2
60+
with:
61+
flutter-version: 3.24.1
62+
- run: flutter pub get
63+
- run: flutter build windows
64+
- name: Archive App
65+
uses: thedoctor0/zip-release@master
66+
with:
67+
type: 'zip'
68+
filename: Dantotsu_Windows_${{github.ref_name}}.zip
69+
directory: build\windows\x64\runner\Release
70+
- name: Upload File To Google Drive
71+
id: gdriveUpload
72+
uses: hoatruongdev09/google-drive-file-upload-github-action@v1.1
73+
with:
74+
file-path: build/windows/x64/runner/Release/Dantotsu_Windows_${{github.ref_name}}.zip
75+
upload-name: Dartotsu_windows.zip
76+
upload-to-folder-id: 1nWYex54zd58SVitJUCva91_4k1PPTdP3
77+
service-account-json: "${{secrets.GOOGLE_KEY}}"
78+
overrwrite: true
79+
- name: Send Download link to discord after Build
80+
id: dealing
81+
run: |
82+
$payload = '{"content": "A new windows build is here check it out: [Dartotsu Windows](${{steps.gdriveUpload.outputs.web-content-link}})"}'
83+
Invoke-RestMethod -Uri ${{secrets.DISCORD_WEBHOOK_URL}} -Method Post -Body $payload -ContentType 'application/json'
84+
shell: pwsh
85+

.github/workflows/dart.yml

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,7 @@ on:
33
push:
44
branches: main
55
jobs:
6-
# build_android:
7-
# runs-on: ubuntu-latest
8-
# steps:
9-
# - name: Cloing repository
10-
# uses: actions/checkout@v4
11-
# - name: Setup Flutter
12-
# uses: subosito/flutter-action@v2
13-
# with:
14-
# flutter-version: 3.24.1
15-
# - run: flutter pub get
16-
# - run: flutter build apk --split-per-abi
176

18-
# - name: Upload APK to Discord
19-
# run: |
20-
# curl -F "payload_json={\"content\": \"Android x86_64 ${{ github.sha}}\"}" \
21-
# -F "file=@build/app/outputs/flutter-apk/app-x86_64-release.apk" \
22-
# ${{ secrets.DISCORD_WEBHOOK_URL }}
23-
24-
# build_windows:
25-
# runs-on: windows-latest
26-
# steps:
27-
# - name: Cloing repository
28-
# uses: actions/checkout@v4
29-
# - name: Setup Flutter
30-
# uses: subosito/flutter-action@v2
31-
# with:
32-
# flutter-version: 3.24.1
33-
# - run: flutter pub get
34-
# - run: flutter build windows
35-
# - name: Archive App
36-
# uses: thedoctor0/zip-release@master
37-
# with:
38-
# type: 'zip'
39-
# filename: Dantotsu-${{github.sha}}-windows.zip
40-
# directory: build\windows\x64\runner\Release
41-
# - name: Upload Windows ZIP to Discord
42-
# shell: pwsh
43-
# run: ./scripts/upload-to-discord.ps1 -webhookUrl ${{ secrets.DISCORD_WEBHOOK_URL }} -filePath build\windows\x64\runner\Release\Dantotsu-${{github.sha}}-windows.zip
447
build_linux:
458
runs-on: ubuntu-latest
469
permissions:
@@ -88,21 +51,17 @@ jobs:
8851
continue-on-error: true
8952
- name: Save Current SHA for Next Run
9053
run: echo ${{ github.sha }} > last_sha.txt
91-
# - name: Setup Flutter
92-
# uses: subosito/flutter-action@v2
93-
# with:
94-
# flutter-version: 3.24.1
95-
# - run: |
96-
# sudo apt-get update -y
97-
# sudo apt-get install -y ninja-build libgtk-3-dev
98-
# - run: flutter pub get
99-
# - run: flutter build linux
100-
# - name: Archive app
101-
# uses: thedoctor0/zip-release@master
102-
# with:
103-
# type: 'zip'
104-
# filename: Dantotsu-${{github.sha}}-linux.zip
105-
# directory: build/linux/x64/release/bundle
54+
55+
# checking if to ping or not
56+
57+
- name: Check for noPing
58+
id: check_noping
59+
run: |
60+
if [[ "${{ github.event.head_commit.message }}" == *"[noPing]"* ]]; then
61+
echo "ping_variable=noping" >> $GITHUB_ENV
62+
else
63+
echo "ping_variable=<@&1298926901833895986>" >> $GITHUB_ENV
64+
fi
10665
- name: Upload APK to Discord and Telegram
10766
shell: bash
10867
run: |
@@ -250,7 +209,7 @@ jobs:
250209
--arg thumbnail_url "$thumbnail_url" \
251210
--argjson embed_color "$embed_color" \
252211
'{
253-
"content": "<@&1298926901833895986>",
212+
"content": "${{env.ping_variable}}",
254213
"embeds": [
255214
{
256215
"title": "New Alpha-Build dropped 🔥",

0 commit comments

Comments
 (0)