-
Notifications
You must be signed in to change notification settings - Fork 8
114 lines (112 loc) · 3.68 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release & Publish
# When a release is published
# TODO: de-duplicate with build
on:
release:
types: [published]
jobs:
buildLinux:
runs-on: ubuntu-latest
container: debian:buster # Using debian buster environment for glibc backwards compatibility, see https://github.com/Yellow-Dog-Man/FreeImage/pull/12
env:
VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Build Native Linux
run: |
apt update
apt install -y make gcc g++ unzip
make all
- uses: actions/upload-artifact@v4
with:
path: Dist/
name: linux-dist
retention-days: 1
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build Arm/Android
run: |
ndk-build NDK_LIBS_OUT=./android/libs NDK_OUT=./android/obj
- uses: actions/upload-artifact@v4
with:
path: android/
name: android-dist
retention-days: 1
buildWindows:
env:
VERSION: ${{ github.event.release.tag_name }}
needs: [buildLinux]
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Build Solution
run: |
msbuild.exe FreeImage.2017.vcxproj /p:Configuration=Release /p:Platform=x64
msbuild.exe FreeImage.2017.vcxproj /p:Configuration=Release /p:Platform=Win32
- uses: actions/upload-artifact@v4
with:
path: Dist/x32
name: win32-dist
- uses: actions/upload-artifact@v4
with:
path: Dist/x64
name: win64-dist
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_TOKEN }}
- name: Download Native Libraries
uses: actions/download-artifact@v4
with:
path: native/
- name: Build
working-directory: ./Wrapper/FreeImage.NET/cs/Library
run: msbuild.exe Library.csproj /p:Configuration=Release
- name: Pack
shell: cmd
working-directory: ./Wrapper/FreeImage.NET/cs/Library
run: nuget pack Library.csproj -OutputDirectory nupkgs -Version ${{ env.VERSION }} -Properties version="${{ env.VERSION }}";Configuration=Release
- uses: actions/upload-artifact@v4
with:
path: Wrapper/FreeImage.NET/cs/Library/nupkgs
name: nuget-dist
upload:
needs: [buildWindows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: ./dist
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_TOKEN }}
- name: Push Nuget
run: nuget push ./dist/nuget-dist/*.nupkg -ApiKey ${{ secrets.NUGET_TOKEN }} -Source https://api.nuget.org/v3/index.json
- name: Prep Archives
run: |
tar -czvf linux-dist.tar.gz ./dist/linux-dist
tar -czvf android-dist.tar.gz ./dist/android-dist
zip -r win32-dist.zip ./dist/win32-dist
zip -r win64-dist.zip ./dist/win64-dist
- name: Upload Tarbells
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*.tar.gz
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload Zips
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true