Skip to content

Commit 4d156e3

Browse files
authored
Switch to GitHub Actions CI (#7)
1 parent 4226d21 commit 4d156e3

4 files changed

Lines changed: 62 additions & 31 deletions

File tree

.appveyor.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CI: true
9+
10+
jobs:
11+
ci:
12+
runs-on: windows-latest
13+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
14+
15+
steps:
16+
- name: Clone repository
17+
uses: actions/checkout@v2
18+
with:
19+
submodules: true
20+
# We need to get all git revisions for `git describe` to work
21+
fetch-depth: 0
22+
23+
- name: Add MSBuild to PATH
24+
uses: microsoft/setup-msbuild@v1
25+
26+
# TODO: cache this?
27+
- name: Set up nasm
28+
uses: ilammy/setup-nasm@v1
29+
with:
30+
version: 2.15.05
31+
32+
- name: Build
33+
run: CALL "build.bat"
34+
shell: cmd
35+
36+
- name: Set Version variable
37+
run: echo "JPEGOPTIM_VER=$(git describe --tags --long)" >> $GITHUB_ENV
38+
shell: bash
39+
40+
- name: Prepare files
41+
run: |
42+
mkdir dist
43+
cp Release/x64/jpegoptim.exe src/jpegoptim/COPYING src/jpegoptim/COPYRIGHT src/jpegoptim/README dist/
44+
shell: bash
45+
46+
- name: Upload binary
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: "jpegoptim-${{ env.JPEGOPTIM_VER }}"
50+
path: dist/
51+
if-no-files-found: error

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jpegoptim for Windows
22

3-
[![Build status](https://img.shields.io/appveyor/ci/XhmikosR/jpegoptim-windows/master.svg)](https://ci.appveyor.com/project/XhmikosR/jpegoptim-windows/branch/master)
3+
[![Build Status](https://github.com/XhmikosR/jpegoptim-windows/workflows/CI/badge.svg?branch=master)](https://github.com/XhmikosR/jpegoptim-windows/actions?query=workflow%3ACI+branch%3Amaster)
44

55
This is just my own project files for easy building of [jpegoptim](https://github.com/tjko/jpegoptim) with [mozjpeg](https://github.com/mozilla/mozjpeg) and Microsoft Visual Studio.
66
Currently only 64-bit (x64) is targeted.

build.bat

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ setlocal
44
cd /d %~dp0
55

66
rem add MSVC in PATH
7-
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsMSBuildCmd.bat"
7+
call :SubVSPath
8+
if not exist "%VS_PATH%" echo ERROR: Visual Studio 2019 NOT FOUND! & goto end
9+
10+
call "%VS_PATH%\Common7\Tools\vsdevcmd" -arch=amd64
811

912
set "MSBUILD_SWITCHES=/nologo /consoleloggerparameters:Verbosity=minimal /maxcpucount /nodeReuse:true"
1013

11-
MSBuild.exe "jpegoptim.sln" %MSBUILD_SWITCHES%^
12-
/target:"Rebuild" /property:Configuration="Release";Platform="x64"
14+
MSBuild.exe "jpegoptim.sln" %MSBUILD_SWITCHES% /target:"Rebuild" /property:Configuration="Release";Platform="x64"
1315

1416
:end
1517
endlocal
16-
rem pause
18+
if not defined CI pause
19+
exit /b
20+
21+
:SubVSPath
22+
for /f "delims=" %%A in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64') do set "VS_PATH=%%A"
1723
exit /b

0 commit comments

Comments
 (0)