|
6 | 6 | paths-ignore:
|
7 | 7 | - '**.md'
|
8 | 8 | - '**.txt'
|
9 |
| - - '**.png' |
10 |
| - - 'auto_editor/__init__.py' |
| 9 | + - 'src/about.nim' |
11 | 10 | branches:
|
12 | 11 | - master
|
13 | 12 | pull_request:
|
14 | 13 | branches:
|
15 | 14 | - master
|
| 15 | +permissions: |
| 16 | + contents: write |
16 | 17 | 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 |
19 | 32 | steps:
|
20 | 33 | - name: Checkout
|
21 | 34 | 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 |
32 | 35 | - name: Nim
|
| 36 | + if: runner.os != 'macOS' |
33 | 37 | uses: jiro4989/setup-nim-action@v2
|
34 | 38 | with:
|
35 | 39 | nim-version: "stable"
|
36 | 40 | repo-token: ${{ secrets.GITHUB_TOKEN }}
|
37 |
| - - name: Docs |
| 41 | + - name: Install packages for macOS |
| 42 | + if: runner.os == 'macOS' |
38 | 43 | 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 }} |
50 | 73 |
|
| 74 | + windows: |
| 75 | + runs-on: ubuntu-latest |
51 | 76 | steps:
|
52 | 77 | - name: Checkout
|
53 | 78 | 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 |
56 | 81 | 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 | + |
0 commit comments