Skip to content

Merge branch 'main' of https://github.com/Fredolx/meme-maker #35

Merge branch 'main' of https://github.com/Fredolx/meme-maker

Merge branch 'main' of https://github.com/Fredolx/meme-maker #35

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install deps linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt install -y build-essential git
git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1
cd ImageMagick-7.1.1
./configure
make -j$(nproc)
sudo make install
sudo ldconfig /usr/local/lib
- name: Install msys2 windows
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
release: false
msystem: mingw64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-zlib
mingw-w64-x86_64-imagemagick
- name: Build Windows
if: matrix.os == 'windows-latest'
working-directory: ./meme-maker
shell: powershell
run: |
$env:CGO_CFLAGS = "-IC:/msys64/mingw64/include/ImageMagick-7"
$env:CGO_LDFLAGS = "-LC:/msys64/mingw64/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI"
$env:PATH += ";C:\msys64\mingw64\bin"
$env:PKG_CONFIG_PATH = "C:\msys64\mingw64\lib\pkgconfig"
$env:MAGICK_CODER_MODULE_PATH = "C:\msys64\mingw64\lib\ImageMagick-7.1.1\modules-Q16HDRI\coders"
.\compile-windows.ps1
- name: Build Linux
if: matrix.os == 'ubuntu-latest'
working-directory: ./meme-maker
run: |
go build -v .
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: meme-maker-linux-amd64
path: ./meme-maker/meme-maker
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: meme-maker-windows-amd64
path: ./meme-maker/build/*