forked from HaijinW/libaribb25
-
Notifications
You must be signed in to change notification settings - Fork 14
103 lines (98 loc) · 4.01 KB
/
build-package.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
name: Package
on: push
jobs:
windows:
name: Windows
strategy:
matrix:
os:
- windows-2019
runs-on: ${{ matrix.os }}
steps:
- name: setup msbuild
uses: microsoft/[email protected]
- uses: actions/checkout@v3
- name: build
run: |
msbuild arib_std_b25.sln /t:Build /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v142
msbuild arib_std_b25.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
- name: get output name
id: get_output_name
run: |
$version = bash -c 'LC_ALL=ja_JP.utf8 grep -oP ''#define VERSION_STRING ""\\K[^""]+'' aribb25/td.c'
echo "archive_path=libaribb25_${version}_windows.zip" >> $ENV:GITHUB_OUTPUT
- name: package
run: |
mkdir libaribb25/
mkdir libaribb25/32bit/
mkdir libaribb25/64bit/
Copy-Item -Path ".\Win32\Release\*" -Destination ".\libaribb25\32bit\" -Recurse -Force
Copy-Item -Path ".\x64\Release\*" -Destination ".\libaribb25\64bit\" -Recurse -Force
Copy-Item -Path libaribb25\32bit\libaribb1.dll -Destination libaribb25\32bit\B1Decoder.dll -Force
Copy-Item -Path libaribb25\64bit\libaribb1.dll -Destination libaribb25\64bit\B1Decoder.dll -Force
Copy-Item -Path libaribb25\32bit\libaribb25.dll -Destination libaribb25\32bit\B25Decoder.dll -Force
Copy-Item -Path libaribb25\64bit\libaribb25.dll -Destination libaribb25\64bit\B25Decoder.dll -Force
7z a -tzip ${{ steps.get_output_name.outputs.archive_path }} libaribb25
- name: save artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_output_name.outputs.archive_path }}
path: ${{ steps.get_output_name.outputs.archive_path }}
deb-package:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: setup
run: sudo apt-get install -y build-essential cmake cmake-data libpcsclite-dev pkg-config
- name: build
run: |
cmake -B build
cd build
make
sudo make install
sudo cpack -G DEB -P libaribb25 -C CPackConfig.cmake
- name: get output name
id: get_output_name
run: |
echo "deb_path=$(ls build/libaribb25_*.deb)" >> "$GITHUB_OUTPUT"
echo "deb_file=$(basename $(ls build/libaribb25_*.deb))" >> "$GITHUB_OUTPUT"
- name: save artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_output_name.outputs.deb_file }}
path: ${{ steps.get_output_name.outputs.deb_path }}
deb-package-arm:
strategy:
matrix:
image:
- arm64v8/ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: setup
uses: docker/build-push-action@v3
with:
context: .github/workflows/
tags: ${{ matrix.image }}:build
build-args: IMAGE=${{ matrix.image }}:20.04
cache-from: type=gha,scope=${{ matrix.image }}
cache-to: type=gha,scope=${{ matrix.image }},mode=max
load: true
- name: build
run: |
mkdir build
docker run --rm -i -v $(pwd):/work -w /work/build -e CLICOLOR_FORCE=1 ${{ matrix.image }}:build bash -c 'cmake --version && cmake ..'
docker run --rm -i -v $(pwd):/work -w /work/build -e CLICOLOR_FORCE=1 ${{ matrix.image }}:build bash -c \
'cpack -G DEB -P libaribb25 -C CPackConfig.cmake'
- name: get output name
id: get_output_name
run: |
echo "deb_path=$(ls build/libaribb25_*.deb)" >> "$GITHUB_OUTPUT"
echo "deb_file=$(basename $(ls build/libaribb25_*.deb))" >> "$GITHUB_OUTPUT"
- name: save artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_output_name.outputs.deb_file }}
path: ${{ steps.get_output_name.outputs.deb_path }}