Skip to content

Commit

Permalink
actions: add workflows (#687)
Browse files Browse the repository at this point in the history
* actions: building and uploading artifacts

* actions: release

* build script: download ocr model
  • Loading branch information
AyaseFile authored Apr 25, 2024
1 parent 5bdda3e commit 24573e5
Show file tree
Hide file tree
Showing 4 changed files with 534 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Upload Artifacts

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- name: Install Python 3.7.9 x86
uses: actions/setup-python@v5
with:
python-version: '3.7.9'
architecture: x86
- name: Install Python 3.7.9 x64
uses: actions/setup-python@v5
with:
python-version: '3.7.9'
architecture: x64
- name: Install Python 3.11.7
uses: actions/setup-python@v5
with:
python-version: '3.11.7'
- name: Run build script
run: |
python build.py --github-actions
- name: Upload LunaTranslator artifact x86
uses: actions/upload-artifact@v4
with:
name: LunaTranslator_x86
path: build/LunaTranslator_x86.zip
- name: Upload LunaTranslator artifact x64
uses: actions/upload-artifact@v4
with:
name: LunaTranslator
path: build/LunaTranslator.zip
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Windows 10 SDK
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- name: Install Python 3.7.9 x86
uses: actions/setup-python@v5
with:
python-version: '3.7.9'
architecture: x86
- name: Install Python 3.7.9 x64
uses: actions/setup-python@v5
with:
python-version: '3.7.9'
architecture: x64
- name: Install Python 3.11.7
uses: actions/setup-python@v5
with:
python-version: '3.11.7'
- name: Run build script
run: |
python build.py --github-actions
- name: Release LunaTranslator
uses: softprops/action-gh-release@v2
with:
files: |
build/LunaTranslator_x86.zip
build/LunaTranslator.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build/

plugins/builds
plugins/build
temp/


LunaTranslator/files/plugins
Expand Down
Loading

0 comments on commit 24573e5

Please sign in to comment.