Skip to content

Commit b651c34

Browse files
authored
Merge branch 'Acode-Foundation:main' into codemirror
2 parents 3459744 + 3f0c4bc commit b651c34

File tree

20 files changed

+740
-93
lines changed

20 files changed

+740
-93
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: community-release-notifier
2+
on:
3+
release:
4+
types: [ released ]
5+
workflow_call:
6+
inputs:
7+
tag_name:
8+
required: true
9+
description: "Release tag_name"
10+
type: 'string'
11+
url:
12+
required: true
13+
description: "release URL"
14+
type: 'string'
15+
secrets:
16+
DISCORD_WEBHOOK_RELEASE_NOTES:
17+
description: 'Discord Webhook for Notifying Releases to Discord'
18+
required: true
19+
20+
jobs:
21+
discord-release:
22+
if: github.repository_owner == 'Acode-Foundation'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Get Release Content
26+
id: get-release-content
27+
uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757 # v1.4.1
28+
with:
29+
maxLength: 2000
30+
stringToTruncate: |
31+
📢 Acode [${{ github.event.release.tag_name || inputs.tag_name }}](<${{ github.event.release.url || inputs.url }}>) was just Released 🎉!
32+
33+
34+
- name: Discord Webhook Action (Publishing)
35+
uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164 # v5.3.0
36+
with:
37+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }}
38+
content: ${{ steps.get-release-content.outputs.string }}
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
name: Nightly Build
2+
3+
on:
4+
schedule:
5+
# Fire every day at 7:00am UTC (Roughly before EU workday and after US workday)
6+
- cron: "0 7 * * *"
7+
push:
8+
tags:
9+
- nightly
10+
workflow_call:
11+
inputs:
12+
is_PR:
13+
default: false
14+
type: boolean
15+
description: If a Pull Request has triggered it.
16+
PR_NUMBER:
17+
required: true
18+
type: number
19+
description: The Pull Request that triggered this workflow
20+
skip_tagging_and_releases:
21+
required: false
22+
default: true
23+
type: boolean
24+
description: Skips Tagging & releases, since workflow_call isn't available for github.event_name, default is true
25+
outputs:
26+
job_result:
27+
description: "Build job result"
28+
value: ${{ jobs.build.result }}
29+
30+
workflow_dispatch:
31+
32+
concurrency:
33+
# Allow only one workflow per any non-`main` branch.
34+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}-${{ inputs.is_PR && 'is_PR' || 'not_PR'}}
35+
cancel-in-progress: true
36+
37+
permissions:
38+
contents: read
39+
40+
env:
41+
STORE_FILE_PATH: /tmp/app-debug.keystore
42+
BUILD_JSON_PATH: build.json
43+
VERSION_LABEL: ${{ (inputs.is_PR && 'pr') || 'nightly' }}
44+
DISCORD_RELEASE_NOTIFIER_ENABLED: "true"
45+
jobs:
46+
build:
47+
timeout-minutes: 60
48+
runs-on: ubuntu-latest
49+
if: github.repository_owner == 'Acode-Foundation'
50+
51+
permissions:
52+
# contents write is needed to create Nightly Releases.
53+
contents: write
54+
issues: write
55+
pull-requests: write
56+
57+
outputs:
58+
release_output_url: ${{ steps.release.outputs.url }}
59+
updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}}
60+
steps:
61+
- name: Fast Fail if secrets are missing
62+
if: ${{ env.KEYSTORE_CONTENT == '' || env.BUILD_JSON_CONTENT == '' }}
63+
env:
64+
KEYSTORE_CONTENT: ${{ secrets.KEYSTORE_CONTENT }}
65+
BUILD_JSON_CONTENT: ${{ secrets.BUILD_JSON_CONTENT }}
66+
run: |
67+
echo "::error title=Missing Secrets::KEYSTORE_CONTENT or BUILD_JSON_CONTENT secrets are missing! Aborting workflow."
68+
exit 1
69+
70+
- name: Logging & summaries
71+
run: |
72+
echo "::group::Logging"
73+
echo "🎯 github trigger event name: ${{ github.event_name }}"
74+
echo "is_PR: ${{ inputs.is_PR }} "
75+
echo "PR_NUMBER: ${{ inputs.PR_NUMBER }}"
76+
echo "env: STORE_FILE_PATH: ${{ env.STORE_FILE_PATH }}"
77+
echo "env: BUILD_JSON_PATH: ${{ env.BUILD_JSON_PATH }}"
78+
echo "env: VERSION_LABEL: ${{ env. VERSION_LABEL }}"
79+
echo "github sha: ${{ github.sha }}"
80+
echo "should not skip tags, releases: ${{ ! inputs.skip_tagging_and_releases }} "
81+
echo "::endgroup::"
82+
83+
echo "## 🚀 Build Type: ${{ env.VERSION_LABEL }}" >> $GITHUB_STEP_SUMMARY
84+
echo "is_PR: ${{ inputs.is_PR || 'NOT a PR' }}" >> $GITHUB_STEP_SUMMARY
85+
echo "PR_NUMBER: ${{ inputs.PR_NUMBER || 'not a PR' }}" >> $GITHUB_STEP_SUMMARY
86+
echo "should not skip tags, releases: ${{ ! inputs.skip_tagging_and_releases }}" >> $GITHUB_STEP_SUMMARY
87+
88+
- name: Checkout Repository
89+
uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0 # Required for tags
92+
93+
- name: Set up Java 21
94+
uses: actions/setup-java@v4
95+
with:
96+
distribution: 'temurin'
97+
java-version: '21'
98+
cache: ${{ (github.ref == 'refs/heads/main' && 'gradle') || '' }}
99+
100+
- name: Set up Node.js
101+
uses: actions/setup-node@v4
102+
with:
103+
node-version: 'lts/*' # or '18.x' for latest stable
104+
105+
- name: Add keystore and build.json from secrets
106+
run: |
107+
echo "${{ secrets.KEYSTORE_CONTENT }}" | base64 -d > $STORE_FILE_PATH
108+
echo "${{ secrets.BUILD_JSON_CONTENT }}" | base64 -d > $BUILD_JSON_PATH
109+
echo "Keystore and build.json added successfully."
110+
111+
- name: Export Commit Hash & prev tag
112+
run: |
113+
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
114+
echo "PREV_TAG=$(git describe --tags --abbrev=0 || git rev-list --max-parents=0 HEAD)" >> $GITHUB_ENV
115+
116+
- name: Extract versionCode and version from config.xml
117+
id: extract_version
118+
run: |
119+
if [ ! -f config.xml ]; then
120+
echo "config.xml not found!"
121+
exit 1
122+
fi
123+
VERSION_CODE=$(grep 'versionCode=' config.xml | sed -E 's/.*versionCode="([0-9]+)".*/\1/')
124+
VERSION=$(grep -oP 'version="\K[0-9.]+' config.xml)
125+
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_OUTPUT
126+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
127+
echo "Extracted Version Code: $VERSION_CODE"
128+
echo "Extracted Version: $VERSION"
129+
130+
- name: Append Commit Hash to Version and Update config.xml
131+
id: update-version
132+
run: |
133+
SHORT_COMMIT_HASH=$(echo "${{ env.GIT_COMMIT }}" | cut -c 1-7)
134+
if ${{ inputs.is_PR || false }}; then
135+
PR_NUMBER=${{ inputs.PR_NUMBER }}
136+
else
137+
PR_NUMBER=
138+
fi
139+
UPDATED_VERSION="${{ steps.extract_version.outputs.VERSION }}-${{ env.VERSION_LABEL }}.${PR_NUMBER:-$SHORT_COMMIT_HASH}"
140+
echo "Updated Version: $UPDATED_VERSION"
141+
142+
# Update config.xml with the new version
143+
sed -i "s/version=\"${{ steps.extract_version.outputs.VERSION }}\"/version=\"$UPDATED_VERSION\"/g" config.xml
144+
echo "Updated version in config.xml"
145+
# Output the updated version
146+
echo "UPDATED_VERSION=$UPDATED_VERSION" >> $GITHUB_ENV
147+
echo "UPDATED_VERSION=$UPDATED_VERSION" >> $GITHUB_OUTPUT
148+
149+
- name: Install Node.js Packages
150+
run: npm install
151+
152+
- name: Run npm setup
153+
run: npm run setup
154+
155+
- name: Run npm build paid dev apk
156+
run: |
157+
npm run build paid dev apk
158+
echo "VERSION: $UPDATED_VERSION" >> $GITHUB_STEP_SUMMARY
159+
160+
- name: Upload APK Artifact
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: app-debug-${{ env.GIT_COMMIT }}
164+
path: platforms/android/app/build/outputs/apk/debug/app-debug.apk
165+
166+
- name: remove keystore and build.json
167+
run: |
168+
rm $STORE_FILE_PATH $BUILD_JSON_PATH
169+
echo "Keystore and build.json removed successfully."
170+
171+
- name: Check Nightly Tag and Force Update
172+
#if: github.event_name == 'push' && contains(github.event.ref, 'tags/nightly') == false
173+
if: ${{ ! inputs.skip_tagging_and_releases }}
174+
run: |
175+
# Check if the nightly tag exists and get the commit it points to
176+
if git show-ref --quiet refs/tags/nightly; then
177+
TAG_COMMIT=$(git rev-parse nightly)
178+
else
179+
TAG_COMMIT=""
180+
fi
181+
182+
# If the current commit is the same as the tag, skip updating the tag
183+
if [ "$TAG_COMMIT" != "${{ env.GIT_COMMIT }}" ]; then
184+
echo "releaseRequired=true" >> $GITHUB_ENV
185+
# export tag commit before updating for change logs comparing.
186+
echo "TAG_COMMIT=$TAG_COMMIT" >> $GITHUB_ENV
187+
188+
git config --global user.name 'GitHub Actions'
189+
git config --global user.email 'github-actions@github.com'
190+
git tag -f nightly
191+
git push origin nightly --force
192+
else
193+
echo "Nightly tag already points to this commit. Skipping update."
194+
fi
195+
196+
- name: Release Nightly Version
197+
# Only run this step, if not called from another workflow. And a previous step is successful with releasedRequired=true
198+
id: release
199+
if: ${{ ! inputs.skip_tagging_and_releases && success() && env.releaseRequired == 'true' }}
200+
uses: softprops/action-gh-release@v2
201+
with:
202+
prerelease: true
203+
name: ${{ env.UPDATED_VERSION }}
204+
tag_name: ${{ env.UPDATED_VERSION }}
205+
files: |
206+
platforms/android/app/build/outputs/apk/debug/app-debug.apk
207+
body: |
208+
Automated Nightly (pre-release) Releases for Today
209+
\n\n[Compare Changes](https://github.com/${{ github.repository }}/compare/${{ env.TAG_COMMIT }}...${{ github.sha }})
210+
211+
- name: Update Last Comment by bot (If ran in PR)
212+
if: inputs.is_PR
213+
uses: marocchino/sticky-pull-request-comment@v2
214+
with:
215+
hide_and_recreate: true
216+
hide_classify: "OUTDATED"
217+
header: on-demand-build-status
218+
message: |
219+
Preview Release for this, has been built.
220+
221+
[Click here to view that github actions build](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }})
222+
223+
224+
community-release-notifier:
225+
needs: build
226+
# Run only if push tags, or triggered by a schedule
227+
if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.build.outputs.release_output_url }}
228+
uses: Acode-Foundation/acode/.github/workflows/community-release-notifier.yml@main
229+
with:
230+
tag_name: ${{ needs.build.outputs.updated_version }}
231+
url: ${{ needs.build.outputs.release_output_url }}
232+
secrets:
233+
DISCORD_WEBHOOK_RELEASE_NOTES: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: On Demand Preview Releases for PR
2+
# avoids paths like .md, and anything in .github folder
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '!*.md'
7+
# - '.github/**'
8+
types: [labeled, synchronize]
9+
10+
# defined at workflow-level as the workflow, Requires these permissions to function.
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
# All Pull Requests are issues, but not all issues are Pull Requests (like GitHub says 🙃)
15+
issues: write
16+
17+
concurrency:
18+
# Allow only one workflow per any non-`main` branch.
19+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
job_trigger:
24+
name: Trigger Preview Release (if conditions met)
25+
if: |
26+
github.event.pull_request.draft == false
27+
&& (github.repository_owner == 'Acode-Foundation'
28+
&& (!contains(github.event.pull_request.labels.*.name, 'DO NOT PREVIEW RELEASE')
29+
&& (contains(github.event.pull_request.labels.*.name, 'Bypass check - PREVIEW RELEASE')
30+
|| contains(github.event.pull_request.labels.*.name, 'CI: RUN ON-DEMAND PREVIEW RELEASES')))
31+
)
32+
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
with:
39+
clean: false
40+
fetch-depth: 0
41+
42+
- name: Remove Manually added PR Label
43+
if: |
44+
contains(github.event.pull_request.labels.*.name, 'CI: RUN ON-DEMAND PREVIEW RELEASES')
45+
46+
run: gh pr edit $PR --remove-label "$labels"
47+
env:
48+
PR: ${{ github.event.pull_request.number }}
49+
labels: 'CI: RUN ON-DEMAND PREVIEW RELEASES'
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Add comment to PR
53+
uses: marocchino/sticky-pull-request-comment@v2
54+
with:
55+
hide_and_recreate: true
56+
hide_classify: "OUTDATED"
57+
header: on-demand-build-status
58+
message: |
59+
⚒️ Starting a workflow to build, Your On-Demand Preview Release/build for ${{ github.event.pull_request.html_url || github.event.pull_request.url }}.
60+
61+
status: **\`🟡 in_progress\`**
62+
63+
Kindly wait, this message may be updated with success or failure status.
64+
65+
For Owners: Please [Click here to view that github actions](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }})/
66+
67+
env:
68+
PR: ${{ github.event.pull_request.number }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
71+
trigger_builder:
72+
needs: job_trigger
73+
secrets: inherit
74+
uses: Acode-Foundation/acode/.github/workflows/nightly-build.yml@main
75+
with:
76+
is_PR: true
77+
PR_NUMBER: ${{ github.event.pull_request.number }}
78+
skip_tagging_and_releases: true
79+
80+
update_Last_Comment:
81+
needs: [job_trigger,trigger_builder]
82+
runs-on: ubuntu-latest
83+
if: ${{ github.repository_owner == 'Acode-Foundation' && always() && contains(fromJSON('["failure","cancelled"]'), needs.trigger_builder.result) }}
84+
steps:
85+
# - name: Checkout code
86+
# uses: actions/checkout@v4
87+
# with:
88+
# clean: false
89+
# fetch-depth: 0
90+
91+
- name: Update Last Comment by bot (if Workflow Triggering failed)
92+
uses: marocchino/sticky-pull-request-comment@v2
93+
with:
94+
hide_and_recreate: true
95+
hide_classify: "OUTDATED"
96+
header: on-demand-build-status
97+
message: |
98+
🔴 (Workflow Trigger stopped), Your On-Demand Preview Release/build for ${{ github.event.pull_request.html_url || github.event.pull_request.url }}.
99+
status: **${{ needs.trigger_builder.result || 'failure'}}**
100+
101+
---
102+
For Owners: Please [Click here to view that github actions](https://github.com/${{ github.repository}}/actions/runs/${{ github.run_id }})

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
* Fixed an issue where the info dialog wouldn't appear for non-editor tabs in #1167
204204
* Fixed incorrect file attributes in FTP by @bajrangCoder in #1194
205205
* Fixed the palette not opening when triggered from an existing palette by @bajrangCoder in #1197
206-
* Fixed trigering of infinite scroll on plugin page while searching by @bajrangCoder in #1200
206+
* Fixed triggering of infinite scroll on plugin page while searching by @bajrangCoder in #1200
207207

208208
### Features
209209
* Improved tab view gesture handling to distinguish between scroll and swipe on the plugin page by @bajrangCoder in #1131

_typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ contaienr = "contaienr"
5050
formate = "formate"
5151
collapsable = "collapsable"
5252
styl = "styl"
53+
shft = "shft"

0 commit comments

Comments
 (0)