Nightly Build #279
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build | |
on: | |
# schedule: | |
# - cron: "0 15 * * *" | |
workflow_dispatch: | |
inputs: | |
manual: | |
description: "Manual Build" | |
required: true | |
type: boolean | |
default: true | |
env: | |
DEFAULT_PYTHON: "3.10" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
name: Check Latest Commit | |
if: github.repository == 'mgylabs/mkbot' && github.event_name != 'workflow_dispatch' | |
outputs: | |
is_new: ${{ steps.checkcommit.outputs.is_new }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Check Commit | |
id: checkcommit | |
run: | | |
python package/ghtool.py -check | |
canary-release: | |
name: Nightly Build | |
needs: check | |
if: always() && (needs.check.result == 'skipped' || needs.check.outputs.is_new == 'true') | |
runs-on: windows-2022 | |
timeout-minutes: 60 | |
environment: | |
name: "Canary" | |
url: https://github.com/mgylabs/mkbot/releases/tag/canary | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
cache: "poetry" | |
cache-dependency-path: | | |
**/poetry.lock | |
.github/flags/release.flag | |
- name: Git Config | |
env: | |
GITHUB_USERNAME: ${{ secrets.DEPLOY_USER }} | |
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | |
run: git config --global url.https://${Env:GITHUB_USERNAME}:${Env:GITHUB_TOKEN}@github.com/.insteadOf https://github.com/ | |
- name: Install dependencies | |
run: | | |
poetry run python -m pip install -U pip | |
poetry install --no-root --without dev -E release | |
- name: Version | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
poetry run 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 } | |
- name: Build MK Bot | |
run: | | |
poetry run scripts\build.bat --canary | |
- name: Packaging | |
run: | | |
& "${Env:programfiles(x86)}\Inno Setup 6\iscc.exe" "/DNameLong=Mulgyeol MK Bot Canary" "/DNameShort=MK Bot Canary" "/DVersion=${Env:mkbot_version}" "/DAppExeName=MKBot-Canary.exe" "/DAppMutex=MKBotCanary" "/DExtDirName=.mkbot-canary" "/DDName=mkbot-canary" "package\MKBot.iss" | |
- name: Compress Setup | |
run: | | |
Compress-Archive -Path MKBotSetup-${Env:mkbot_version}.exe -DestinationPath MKBotSetup.zip | |
- name: Upload Release Asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
poetry run python package/ghtool.py -uca |