Skip to content

Commit ec9a5f7

Browse files
joschilovell
authored andcommitted
Build libvips with a GitHub Actions workflow (#31)
The version of libvips can be defined in the `LIBVIPS_VERSION` file in the root of the repository. Every time a new tag starting with 'v*', such as `v8.8.1` is being pushed, the "build-release" workflow will be triggered and do the following things: * Create a pre-release for the tag on GitHub * Build libvips with the version provided in `LIBVIPS_VERSION` for every platform * Upload the release artifacts to the GitHub release which was created before
1 parent eb6b521 commit ec9a5f7

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
create-release:
8+
runs-on: 'ubuntu-latest'
9+
steps:
10+
- name: Create Release
11+
id: create-release
12+
uses: actions/create-release@v1
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
tag_name: ${{ github.ref }}
17+
release_name: Release ${{ github.ref }}
18+
draft: false
19+
prerelease: true
20+
- shell: bash
21+
run: |
22+
echo '${{ steps.create-release.outputs.upload_url }}' > upload-url.txt
23+
- name: Save GitHub release upload URL for next job
24+
uses: actions/upload-artifact@v1
25+
with:
26+
name: upload-url
27+
path: upload-url.txt
28+
build:
29+
runs-on: 'ubuntu-latest'
30+
needs:
31+
- 'create-release'
32+
strategy:
33+
matrix:
34+
platform:
35+
- 'linux-x64'
36+
- 'linuxmusl-x64'
37+
- 'linux-armv6'
38+
- 'linux-armv7'
39+
- 'linux-arm64v8'
40+
- 'win32-x64'
41+
steps:
42+
- uses: actions/checkout@v1
43+
- name: Fetch GitHub Release upload URL
44+
uses: actions/download-artifact@v1
45+
with:
46+
name: upload-url
47+
- name: Set up environment variables
48+
shell: bash
49+
run: |
50+
echo "::set-env name=upload_url::$(cat upload-url/upload-url.txt)"
51+
echo "::set-env name=asset_file_name::libvips-$(cat LIBVIPS_VERSION)-${{ matrix.platform }}.tar.gz"
52+
- name: Build ${{ matrix.platform }}
53+
run: ./build.sh $(cat LIBVIPS_VERSION) ${{ matrix.platform }}
54+
- name: Upload Release Asset
55+
id: upload-release-asset
56+
uses: actions/[email protected]
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ env.upload_url }}
61+
asset_path: ${{ env.asset_file_name }}
62+
asset_name: ${{ env.asset_file_name }}
63+
asset_content_type: application/gzip

LIBVIPS_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.8.1

0 commit comments

Comments
 (0)