-
Notifications
You must be signed in to change notification settings - Fork 5
119 lines (104 loc) · 3.51 KB
/
build_all.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
115
116
117
118
119
# Run building workflows for all supported platforms
name: build_all
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
ZIP_NAME: TexconvCustomDLL
CACHE_NAME: main
jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-tag.outputs.tag }}
steps:
- name: Check tag
id: check-tag
run: |
if [[ ${{ github.ref }} == refs/tags/v* ]]; then
TAG=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
else
TAG=$(echo ${{ github.sha }} | cut -c1-7)
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
shell: bash
- name: Create Release Draft
id: create-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.check-tag.outputs.tag }}
name: ${{ steps.check-tag.outputs.tag }}
body: |
Changelog
- First Change
- Second Change
draft: true
prerelease: false
build_windows:
runs-on: windows-2022
needs: setup
steps:
- uses: actions/checkout@v4
- run: git submodule update --init --recursive DirectXTex
- name: build exe
run: |
batch_files/build.bat
batch_files/build_as_exe.bat
- name: Copy files
run: |
mkdir -p release
cp texconv.dll release/
cp texconv.exe release/
cp texassemble.exe release/
cp changelog.txt release/
cp LICENSE release/
shell: bash
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
directory: 'release'
type: 'zip'
filename: '${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip'
exclusions: '*.git* .gitignore'
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.setup.outputs.tag }} release/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}.zip
build_unix:
strategy:
matrix:
os: [ubuntu-20.04, macos-11]
use_libs: [false, true]
runs-on: ${{ matrix.os }}
needs: setup
steps:
- uses: actions/checkout@v4
- run: |
git submodule update --init --recursive
bash shell_scripts/get_sal.sh
- name: build texconv
if: matrix.use_libs == false
run: |
bash shell_scripts/build.sh
bash shell_scripts/build_as_exe.sh
- name: build texconv with libjpeg and libpng
if: matrix.use_libs == true
run: |
bash shell_scripts/build_with_jpg_png.sh
bash shell_scripts/build_as_exe_with_jpg_png.sh
- name: Copy files
run: |
mkdir -p release/${{ env.ZIP_NAME }}
cp libtexconv.* release/${{ env.ZIP_NAME }}
cp texconv release/${{ env.ZIP_NAME }}
cp texassemble release/${{ env.ZIP_NAME }}
cp changelog.txt release/${{ env.ZIP_NAME }}
cp LICENSE release/${{ env.ZIP_NAME }}
cd release
tar -jcvf ${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}${{ ((matrix.use_libs == false) && '-no-deps') || '' }}.tar.bz2 ${{ env.ZIP_NAME }}
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.setup.outputs.tag }} release/${{ env.ZIP_NAME }}-${{ needs.setup.outputs.tag }}-${{ runner.os }}${{ ((matrix.use_libs == false) && '-no-deps') || '' }}.tar.bz2