Skip to content

Commit

Permalink
Replace AppVeyor with GitHub Actions
Browse files Browse the repository at this point in the history
Build tagged released using GitHub Actions instead of relying on
AppVeyor. This makes it easier to retain older binary versions.
  • Loading branch information
Björn Blissing committed Aug 10, 2021
1 parent 6029679 commit 81bff3a
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 110 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,78 @@
# Workflow to build binary artifacts for tagged versions
name: Build


# Triggers the workflow when a new tag is pushed (but disregard new branches)
on:
push:
tags:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a matrix job called "Release"
Release:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- name: v141-x86
os: windows-2016
generator: "Visual Studio 15 2017"
arch: Win32
- name: v141-x64
os: windows-2016
generator: "Visual Studio 15 2017"
arch: x64
- name: v142-x86
os: windows-2019
generator: "Visual Studio 16 2019"
arch: Win32
- name: v142-x64
os: windows-2019
generator: "Visual Studio 16 2019"
arch: x64

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2

- name: Cache source code
uses: actions/cache@v2
with:
# Cache the downloaded external source code and only update the cache when the download_dependencies.bat file is changed
path: c:/3rdparty
key: ${{ hashFiles('download_dependencies.bat') }}

# Download source code
- name: Download source code
run: .\download_dependencies.bat

# Compile code
- name: Compile code
run: |
mkdir build
cd build
cmake ${env:GITHUB_WORKSPACE} -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -DZLIB_SOURCE_DIR=c:/3rdparty/zlib -DLIBPNG_SOURCE_DIR=c:/3rdparty/libpng -DLIBJPEG_SOURCE_DIR=c:/3rdparty/libjpeg -DLIBTIFF_SOURCE_DIR=c:/3rdparty/tiff -DFREETYPE_SOURCE_DIR=c:/3rdparty/freetype -DGLUT_SOURCE_DIR=c:/3rdparty/glut -DGIFLIB_SOURCE_DIR=c:/3rdparty/giflib -DCURL_SOURCE_DIR=c:/3rdparty/curl -DCMAKE_INSTALL_PREFIX="C:/projects/osg-3rdparty-cmake/build/3rdParty/${{ matrix.name }}"
cmake --build . --config "Debug" --target install
cmake --build . --config "Release" --target install
- name: Compress archive
run: |
cd C:\projects\osg-3rdparty-cmake\build\3rdParty\${{ matrix.name }}
7z a C:\projects\osg-3rdparty-cmake\${{ matrix.name }}.zip .
- name: Publish artifact
uses: ncipollo/release-action@v1
with:
artifacts: "c:\\projects\\osg-3rdparty-cmake\\${{ matrix.name }}.zip"
allowUpdates: true
bodyFile: "versions.md"
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -29,7 +29,7 @@ if(MSVC)
elseif(${MSVC_VERSION} GREATER 1910 AND ${MSVC_VERSION} LESS 1920)
set(TOOLSET "v141") # Visual Studio 2017
elseif(${MSVC_VERSION} GREATER 1919)
set(TOOLSET "v141") # Visual Studio 2019
set(TOOLSET "v142") # Visual Studio 2019
endif()
endif()

Expand Down
33 changes: 7 additions & 26 deletions README.md
Expand Up @@ -10,22 +10,20 @@ The source code for respective library has to be downloaded separately, see down
By building the INSTALL target for both debug and release these scripts will create a folder named `3rdParty`.
Inside this folder there will folders created to represent each platform toolset.


### Status: [![Build status](https://ci.appveyor.com/api/projects/status/xtrxxowo68nyrj9m?svg=true)](https://ci.appveyor.com/project/bjornblissing/osg-3rdparty-cmake)
### Status: ![Build status](https://github.com/bjornblissing/osg-3rdparty-cmake/actions/workflows/build.yml/badge.svg)


Prebuilt versions
----------------

Prebuilt version can be found under *Releases*. Version numbers if the included dependencies can be found in the [versions.md](versions.md) file.

Toolset | Prebuilt archive
------------ | -------------
Visual Studio 2015 32-bit | [v140-x86.zip](https://ci.appveyor.com/api/projects/bjornblissing/osg-3rdparty-cmake/artifacts/v140-x86.zip?job=Environment%3A+Name%3Dv140-x86%2C+APPVEYOR_BUILD_WORKER_IMAGE%3DVisual+Studio+2015%2C+Generator%3DVisual+Studio+14+2015)
Visual Studio 2015 64-bit | [v140-x64.zip](https://ci.appveyor.com/api/projects/bjornblissing/osg-3rdparty-cmake/artifacts/v140-x64.zip?job=Environment%3A+Name%3Dv140-x64%2C+APPVEYOR_BUILD_WORKER_IMAGE%3DVisual+Studio+2015%2C+Generator%3DVisual+Studio+14+2015+Win64)
Visual Studio 2017 32-bit | [v141-x86.zip](https://ci.appveyor.com/api/projects/bjornblissing/osg-3rdparty-cmake/artifacts/v141-x86.zip?job=Environment%3A+Name%3Dv141-x86%2C+APPVEYOR_BUILD_WORKER_IMAGE%3DVisual+Studio+2017%2C+Generator%3DVisual+Studio+15+2017)
Visual Studio 2017 64-bit | [v141-x64.zip](https://ci.appveyor.com/api/projects/bjornblissing/osg-3rdparty-cmake/artifacts/v141-x64.zip?job=Environment%3A+Name%3Dv141-x64%2C+APPVEYOR_BUILD_WORKER_IMAGE%3DVisual+Studio+2017%2C+Generator%3DVisual+Studio+15+2017+Win64)


_Prebuilt versions courtesy of [AppVeyor](https://www.appveyor.com)_
Visual Studio 2017 32-bit | v141-x86.zip
Visual Studio 2017 64-bit | v141-x64.zip
Visual Studio 2019 32-bit | v142-x86.zip
Visual Studio 2019 64-bit | v142-x64.zip


License
Expand Down Expand Up @@ -56,72 +54,55 @@ In your binary directory there will now be a folder named `3rdParty` with a sub-

zlib
----
Latest version tested: 1.2.11

Sources for zlib can be downloaded from:

http://www.zlib.net/


libpng
------
Latest version tested: 1.6.37

Sources for libpng can be downloaded from:

http://www.libpng.org/pub/png/libpng.html


libjpeg
-------
Latest version tested: 9d

Sources for libjpeg can be downloaded from:

http://www.ijg.org/


libtiff
-------
Latest version tested: 4.2.0

Sources for libtiff can be downloaded from:

https://gitlab.com/libtiff/libtiff


FreeType
--------
Latest version tested: 2.10.4

Sources for FreeType can be downloaded from:

http://www.freetype.org/


GLUT
----
Latest version tested: markkilgard/glut@8cd96cb440f1f2fac3a154227937be39d06efa53

Sources for GLUT can be downloaded from:

https://github.com/markkilgard/glut


GIFLIB
------
Latest version tested: 5.2.1

Sources for GIFLIB can be downloaded from:

http://sourceforge.net/projects/giflib/


cURL
----

Latest version tested: 7.76.1

Sources for cURL can be downloaded from:

http://curl.haxx.se/
82 changes: 0 additions & 82 deletions appveyor.yml

This file was deleted.

7 changes: 6 additions & 1 deletion download_dependencies.bat
@@ -1,3 +1,8 @@
set BUILD_FOLDER=%cd%

REM Disable the warning for detached head
git config --global advice.detachedHead false

REM zlib
git clone --depth 1 --single-branch --branch v1.2.11 https://github.com/madler/zlib.git c:/3rdparty/zlib

Expand All @@ -19,7 +24,7 @@ REM glut
git clone https://github.com/markkilgard/glut.git c:/3rdparty/glut
cd c:\3rdparty\glut
git reset --hard 8cd96cb440f1f2fac3a154227937be39d06efa53
cd %APPVEYOR_BUILD_FOLDER%
cd %BUILD_FOLDER%

REM giflib
git clone --depth 1 --single-branch --branch 5.2.1 https://git.code.sf.net/p/giflib/code.git c:/3rdparty/giflib
Expand Down
10 changes: 10 additions & 0 deletions versions.md
@@ -0,0 +1,10 @@
Library | Version
------- | -------
zlib | 1.2.11
libpng | 1.6.37
libjpeg | 9d
libtiff | 4.2.0
FreeType | 2.10.4
GLUT | SHA:8cd96cb440f1f2fac3a154227937be39d06efa53
GIFLIB | 5.2.1
cURL | 7.76.1

0 comments on commit 81bff3a

Please sign in to comment.