Skip to content

Commit f4474b2

Browse files
committed
Rewrite in Nim
1 parent 1c6d5af commit f4474b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+8986
-9430
lines changed

.github/workflows/build.yml

Lines changed: 81 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,104 @@ on:
66
paths-ignore:
77
- '**.md'
88
- '**.txt'
9-
- '**.png'
10-
- 'auto_editor/__init__.py'
9+
- 'src/about.nim'
1110
branches:
1211
- master
1312
pull_request:
1413
branches:
1514
- master
15+
permissions:
16+
contents: write
1617
jobs:
17-
style:
18-
runs-on: ubuntu-latest
18+
main:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
include:
23+
- os: ubuntu-latest
24+
arch: x86_64
25+
binary_name: auto-editor-linux-x86_64
26+
- os: macos-13
27+
arch: x86_64
28+
binary_name: auto-editor-macos-x86_64
29+
- os: macos-latest
30+
arch: arm64
31+
binary_name: auto-editor-macos-arm64
1932
steps:
2033
- name: Checkout
2134
uses: actions/checkout@v4
22-
- name: Python
23-
uses: actions/setup-python@v5
24-
with:
25-
python-version: "3.12"
26-
- name: Lint
27-
run: |
28-
pip install .
29-
pip install -U ruff mypy
30-
ruff format --check auto_editor
31-
mypy auto_editor
3235
- name: Nim
36+
if: runner.os != 'macOS'
3337
uses: jiro4989/setup-nim-action@v2
3438
with:
3539
nim-version: "stable"
3640
repo-token: ${{ secrets.GITHUB_TOKEN }}
37-
- name: Docs
41+
- name: Install packages for macOS
42+
if: runner.os == 'macOS'
3843
run: |
39-
make -C docs compile
40-
make -C docs html
41-
42-
main:
43-
strategy:
44-
matrix:
45-
os: [ubuntu-latest, windows-latest, macos-latest]
46-
python-version: ["3.10"]
47-
48-
runs-on: ${{ matrix.os }}
49-
timeout-minutes: 20
44+
brew update && brew install nim
45+
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
46+
- name: Setup
47+
run: |
48+
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
49+
sudo apt-get update
50+
sudo apt-get install -y build-essential pkg-config nasm git
51+
elif [ "${{ matrix.os }}" = "macos-13" ]; then
52+
brew install nasm
53+
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
54+
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
55+
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
56+
fi
57+
- name: Build FFmpeg
58+
run: nimble makeff
59+
- name: Compile
60+
run: nimble make
61+
- name: Test
62+
run: nimble test
63+
- name: Rename binary
64+
run: |
65+
mv auto-editor ${{ matrix.binary_name }}
66+
- name: Upload to Release
67+
if: github.event_name == 'release'
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
files: ${{ matrix.binary_name }}
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5073

74+
windows:
75+
runs-on: ubuntu-latest
5176
steps:
5277
- name: Checkout
5378
uses: actions/checkout@v4
54-
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v5
79+
- name: Nim
80+
uses: jiro4989/setup-nim-action@v2
5681
with:
57-
python-version: ${{ matrix.python-version }}
58-
- name: Install Auto-Editor
59-
run: pip install .
60-
- name: Run Debug
61-
run: auto-editor --debug
62-
- name: Test
63-
run: auto-editor test all
82+
nim-version: "stable"
83+
repo-token: ${{ secrets.GITHUB_TOKEN }}
84+
- name: Install mingw-w64
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install -y mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev
88+
sudo apt-get install -y build-essential pkg-config nasm git
89+
- name: Build FFmpeg
90+
run: nimble makeffwin
91+
- name: Compile
92+
run: nimble windows
93+
- name: Rename binary
94+
run: |
95+
mv auto-editor.exe auto-editor-windows-amd64.exe
96+
97+
# - name: Upload
98+
# uses: actions/upload-artifact@v4
99+
# with:
100+
# name: dist-${{ matrix.arch }}
101+
# path: auto-editor-windows-amd64.exe
102+
- name: Upload to Release
103+
if: github.event_name == 'release'
104+
uses: softprops/action-gh-release@v1
105+
with:
106+
files: auto-editor-windows-amd64.exe
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+

.gitignore

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1+
auto-editor
2+
build
3+
ffmpeg_sources
4+
.vscode
5+
tests/*
6+
!tests/*.nim
7+
!tests/*.py
8+
19
# Auto-Editor Generated Files
2-
example_ALTERED.mp4
10+
*_ALTERED*
311
*https*
4-
config.pal
12+
*.v3
13+
14+
# OS Files
15+
.DS_Store
16+
*.dylib
17+
*.o
518

619
# Python Generated Files
720
__pycache__/
821
*.pyc
922
*.pyo
1023
*.spec
11-
12-
# Build Files
13-
build/
14-
dist/
1524
*.egg-info/
16-
17-
# OS Files
18-
.DS_Store
19-

0 commit comments

Comments
 (0)