Skip to content

Rewrite in Nim

Rewrite in Nim #2002

Workflow file for this run

name: build
on:
release:
types: [created]
push:
paths-ignore:
- '**.md'
- '**.txt'
- 'src/about.nim'
branches:
- master
pull_request:
branches:
- master
permissions:
contents: write
jobs:
main:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
binary_name: auto-editor-linux-x86_64
- os: macos-13
arch: x86_64
binary_name: auto-editor-macos-x86_64
- os: macos-latest
arch: arm64
binary_name: auto-editor-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Nim
if: runner.os != 'macOS'
uses: jiro4989/setup-nim-action@v2
with:
nim-version: "stable"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install packages for macOS
if: runner.os == 'macOS'
run: |
brew update && brew install nim
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
- name: Setup
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y build-essential pkg-config nasm git
elif [ "${{ matrix.os }}" = "macos-13" ]; then
brew install nasm
echo "MACOSX_DEPLOYMENT_TARGET=13.0" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
fi
- name: Build FFmpeg
run: nimble makeff
- name: Compile
run: nimble make
- name: Test
run: nimble test
- name: Rename binary
run: |
mv auto-editor ${{ matrix.binary_name }}
- name: Upload to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.binary_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: "stable"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install mingw-w64
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev
sudo apt-get install -y build-essential pkg-config nasm git
- name: Build FFmpeg
run: nimble makeffwin
- name: Compile
run: nimble windows
- name: Rename binary
run: |
mv auto-editor.exe auto-editor-windows-amd64.exe
# - name: Upload
# uses: actions/upload-artifact@v4
# with:
# name: dist-${{ matrix.arch }}
# path: auto-editor-windows-amd64.exe
- name: Upload to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: auto-editor-windows-amd64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}