Skip to content

Commit

Permalink
Support beta update
Browse files Browse the repository at this point in the history
  • Loading branch information
MycroftKang committed Dec 14, 2022
1 parent b5f238f commit 63083e7
Show file tree
Hide file tree
Showing 31 changed files with 372 additions and 178 deletions.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
## PR Checklist

- [ ] Closes #xxx
- [ ] [Changelog entry](https://github.com/mgylabs/mulgyeol-mkbot/tree/main/changelogs)
- [ ] [Changelog entry](https://github.com/mgylabs/mkbot/tree/main/changelogs)

### Testing

- [ ] [Tested in packaged application](https://github.com/mgylabs/mulgyeol-mkbot/wiki/How-to-Contribute#testing-in-packaged-application)
- [ ] [Tested in packaged application](https://github.com/mgylabs/mkbot/wiki/How-to-Contribute#testing-in-packaged-application)

### Dependency Changes

- [ ] Labeled as `dependencies`
- [ ] [Validated hook files](https://github.com/mgylabs/mulgyeol-mkbot/wiki/How-to-Contribute#add-hook-files)
- [ ] [Validated hook files](https://github.com/mgylabs/mkbot/wiki/How-to-Contribute#add-hook-files)

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: pylint
if: ${{ always() }}
run: |
pylint src tests
pylint src/bot src/msu src/lib
- name: black
if: ${{ always() }}
run: |
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Beta Release

on:
workflow_dispatch:
inputs:
manual:
description: "Manual Build"
required: true
type: boolean
default: true

jobs:
beta-release:
name: Beta Release
if: github.repository == 'mgylabs/mkbot'
runs-on: windows-2019
environment:
name: "Beta"
url: https://github.com/mgylabs/mkbot/releases/tag/beta
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- uses: webfactory/ssh-agent@v0.5.1
name: Install SSH key
id: install-ssh
continue-on-error: true
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
shell: pwsh
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Install dependencies 1
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
shell: pwsh
- name: Install dependencies 2
if: steps.install-ssh.outcome == 'success'
run: |
pip install --no-cache-dir git+ssh://git@github.com/MycroftKang/application-insights-python.git
shell: pwsh
- name: Version
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
python package/vc.py --beta ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
echo "mkbot_version=$(cat version.txt)" >> $env:GITHUB_ENV
if ($Env:API_KEY) { echo $Env:API_KEY > src\lib\mgylabs\constants\APIKey.py }
shell: pwsh
- name: Build MK Bot
run: |
call scripts\build.bat --stable
- name: Packaging
run: |
& "${Env:programfiles(x86)}\Inno Setup 6\iscc.exe" "/DNameLong=Mulgyeol MK Bot" "/DNameShort=MK Bot" "/DVersion=${Env:mkbot_version}" "/DAppExeName=MKBot.exe" "/DAppMutex=MKBot" "/DExtDirName=.mkbot" "/DDName=mkbot" "package\MKBot.iss"
shell: pwsh
- name: Compress Setup
run: |
Compress-Archive -Path MKBotSetup-${Env:mkbot_version}.exe -DestinationPath MKBotSetup.zip
shell: pwsh
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python package/ghtool.py -ubeta
6 changes: 3 additions & 3 deletions .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
check:
runs-on: ubuntu-latest
name: Check Latest Commit
if: github.repository == 'mgylabs/mulgyeol-mkbot'
if: github.repository == 'mgylabs/mkbot'
outputs:
is_new: ${{ steps.checkcommit.outputs.is_new }}
steps:
Expand All @@ -39,7 +39,7 @@ jobs:
runs-on: windows-2019
environment:
name: "Canary"
url: https://github.com/mgylabs/mulgyeol-mkbot/releases/tag/canary
url: https://github.com/mgylabs/mkbot/releases/tag/canary
defaults:
run:
shell: cmd
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
python package/vc.py -gn ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
python package/vc.py --canary ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
echo "mkbot_version=$(cat version.txt)" >> $env:GITHUB_ENV
if ($Env:API_KEY) { echo $Env:API_KEY > src\lib\mgylabs\constants\APIKey.py }
shell: pwsh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
stable-release:
name: Stable Release
if: github.repository == 'mgylabs/mulgyeol-mkbot'
if: github.repository == 'mgylabs/mkbot'
runs-on: windows-2019
environment:
name: "Stable"
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
python package/vc.py -gr ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
python package/vc.py --stable ; if ($LASTEXITCODE) { exit $LASTEXITCODE }
echo "mkbot_version=$(cat version.txt)" >> $env:GITHUB_ENV
if ($Env:API_KEY) { echo $Env:API_KEY > src\lib\mgylabs\constants\APIKey.py }
shell: pwsh
Expand Down
17 changes: 13 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"program": "${workspaceFolder}\\src\\bot\\discord_host.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}\\src\\bot",
"python": "${command:python.interpreterPath}"
"python": "${command:python.interpreterPath}",
"autoReload": {
"enable": true,
}
},
{
"name": "Python: main.py",
Expand All @@ -20,7 +23,10 @@
"program": "${workspaceFolder}\\src\\bot\\main.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}\\src\\bot",
"python": "${command:python.interpreterPath}"
"python": "${command:python.interpreterPath}",
"autoReload": {
"enable": true,
}
},
{
"name": "Python: nodemon",
Expand All @@ -44,7 +50,10 @@
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}",
"python": "${command:python.interpreterPath}"
}
"python": "${command:python.interpreterPath}",
"autoReload": {
"enable": true,
}
},
]
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
],
"python.testing.pytestEnabled": false,
"files.insertFinalNewline": true,
"editor.formatOnType": true,
"editor.formatOnPaste": false,
"editor.formatOnSaveMode": "file",
"prettier.tabWidth": 2
"prettier.tabWidth": 2,
"omnisharp.useModernNet": false,
}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Mulgyeol MK Bot is an open source local-hosted discord Bot.
Self-host discord bot on your own local Windows PC.

<div align="center">
<a href="https://github.com/mgylabs/mulgyeol-mkbot"><img src="https://user-images.githubusercontent.com/58393346/107910325-882aff80-6f9d-11eb-992d-115948014d3b.png" alt="Mulgyeol MK Bot"></a>
<a href="https://github.com/mgylabs/mkbot"><img src="https://user-images.githubusercontent.com/58393346/107910325-882aff80-6f9d-11eb-992d-115948014d3b.png" alt="Mulgyeol MK Bot"></a>
</div>

## Features
Expand All @@ -24,13 +24,13 @@ Self-host discord bot on your own local Windows PC.

### Mulgyeol MK Bot Stable

- See [Release Note for Stable](https://github.com/mgylabs/mulgyeol-mkbot/releases/latest) for downloading stable release
- See [Release Note for Stable](https://github.com/mgylabs/mkbot/releases/latest) for downloading stable release

### Mulgyeol MK Bot Canary

> Be warned: Canary can be unstable.
- See [Release Note for Nightly](https://github.com/mgylabs/mulgyeol-mkbot/releases/tag/canary) for downloading nightly build
- See [Release Note for Nightly](https://github.com/mgylabs/mkbot/releases/tag/canary) for downloading nightly build

### Build from Source

Expand All @@ -53,7 +53,7 @@ Self-host discord bot on your own local Windows PC.

3. When `build` task is complete, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> again and select `package`.

4. Run `MKBotSetup.exe` to install `MK Bot`.
4. Run `MKBotSetup-Pre.exe` to install `MK Bot`.

> **Note**
> If you install MK Bot manually, MK Bot will not auto-update when new builds are released so you will need to regularly build and install from source to receive all the latest fixes and improvements.
Expand All @@ -74,7 +74,6 @@ Self-host discord bot on your own local Windows PC.
```jsonc
{
"discordToken": "Your Discord Bot Token",
"discordAppID": 1234567890, //Your Discord App ID
"discordAppCmdGuilds": [123456789123456789], //Your Discord Guild ID
"kakaoToken": "Your KakaoTalk REST API Token"
}
Expand All @@ -91,4 +90,4 @@ Self-host discord bot on your own local Windows PC.

---

For more infomation, See [Project Wiki](https://github.com/mgylabs/mulgyeol-mkbot/wiki/How-to-Contribute).
For more infomation, See [Project Wiki](https://github.com/mgylabs/mkbot/wiki/How-to-Contribute).
4 changes: 4 additions & 0 deletions changelogs/unreleased/support-beta-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Support beta update
pull_request:
type: features
7 changes: 4 additions & 3 deletions package/MKBot.iss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ AppName={#NameLong}
AppVersion={#Version}
AppVerName={#NameLong}
AppPublisher=Mulgyeol Labs
AppPublisherURL=https://www.mgylabs.com/
AppSupportURL=https://www.mgylabs.com/
AppUpdatesURL=https://www.mgylabs.com/
AppPublisherURL=https://github.com/mgylabs/mkbot
AppSupportURL=https://github.com/mgylabs/mkbot
AppUpdatesURL=https://github.com/mgylabs/mkbot
DefaultDirName={userpf}\{#NameLong}
DisableDirPage=yes
DisableProgramGroupPage=yes
Expand All @@ -31,6 +31,7 @@ PrivilegesRequiredOverridesAllowed=commandline
OutputDir={#RepoDir}
OutputBaseFilename=MKBotSetup-{#Version}
SetupIconFile={#RepoDir}\resources\package\mkbot.ico
WizardImageFile={#RepoDir}\resources\package\welcome.bmp
WizardSmallImageFile={#RepoDir}\resources\package\mkbot_sq.bmp
UninstallDisplayIcon={app}\{#AppExeName}
Compression=lzma
Expand Down
2 changes: 1 addition & 1 deletion package/MKBot.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!searchreplace PRODUCT_SHORT_NAME "${PRODUCT_NAME}" "Mulgyeol " ""
!searchreplace PRODUCT_EXE_NAME "${PRODUCT_EXE}" ".exe" ""
!define PRODUCT_PUBLISHER "Mulgyeol Labs"
!define PRODUCT_WEB_SITE "https://github.com/mgylabs/mulgyeol-mkbot"
!define PRODUCT_WEB_SITE "https://github.com/mgylabs/mkbot"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_EXE}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKCU"
Expand Down
3 changes: 1 addition & 2 deletions package/data/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "https://mgylabs.gitlab.io/mulgyeol-mkbot/config.schema",
"$schema": "https://raw.githubusercontent.com/mgylabs/mkbot/main/public/config.schema.json",
"discordToken": "Your Token",
"discordAppID": 1234567890,
"discordAppCmdGuilds": [],
"kakaoToken": "Your Token",
"commandPrefix": ".",
Expand Down
2 changes: 1 addition & 1 deletion package/data/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://mgylabs.gitlab.io/mulgyeol-mkbot/extensions.schema",
"$schema": "https://raw.githubusercontent.com/mgylabs/mkbot/main/public/extensions.schema.json",
"extensions": []
}
Loading

0 comments on commit 63083e7

Please sign in to comment.