-
Notifications
You must be signed in to change notification settings - Fork 43
82 lines (78 loc) · 2.71 KB
/
release.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
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
ghrelease:
name: Publish sources on GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: |
./bootstrap.sh
./configure
- name: Build source packages
run: |
make dist
bzip2 -d -k bzip3-${{ github.ref_name }}.tar.bz2
zstd -19 bzip3-${{ github.ref_name }}.tar
7z a bzip3-${{ github.ref_name}}.tar{.7z,}
- name: Build a binary (for dogfooding)
run: make
- name: Create a dogfood package
run: |
./bzip3 -e bzip3-${{ github.ref_name }}.tar
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
files: |
bzip3-${{ github.ref_name }}.tar
bzip3-${{ github.ref_name }}.tar.7z
bzip3-${{ github.ref_name }}.tar.bz2
bzip3-${{ github.ref_name }}.tar.bz3
bzip3-${{ github.ref_name }}.tar.gz
bzip3-${{ github.ref_name }}.tar.xz
bzip3-${{ github.ref_name }}.tar.zst
bzip3-${{ github.ref_name }}.zip
- name: Upload source package artifact
uses: actions/upload-artifact@v4
with:
name: bzip3-${{ github.ref_name }}
path: bzip3-${{ github.ref_name }}.tar.gz
binaries:
name: Publish Binaries on GitHub Release
needs: [ ghrelease ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- [ "x86_64-linux", "--enable-static-exe --disable-arch-native", "" ]
- [ "x86_64", "CC=x86_64-w64-mingw32-gcc --host x86_64-w64-mingw32 --enable-static-exe --disable-arch-native", "gcc-mingw-w64-x86-64" ]
- [ "i686", "CC=i686-w64-mingw32-gcc --host i686-w64-mingw32 --enable-static-exe --disable-arch-native", "gcc-mingw-w64-i686" ]
steps:
- name: Download source package artifact
uses: actions/download-artifact@v4
with:
name: bzip3-${{ github.ref_name }}
- name: Extract source package
run: tar --strip-components=1 -xf bzip3-${{ github.ref_name }}.tar.gz
- name: Install cross-compile dependencies
if: ${{ matrix.target[2] }}
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.target[2] }}
- name: Configure
run: ./configure --bindir=/ --program-suffix=-${{ matrix.target[0] }} ${{ matrix.target[1] }}
- name: Make
run: |
make
make DESTDIR=$(pwd)/output install-exec
- name: Publish binary
uses: softprops/action-gh-release@v1
with:
files: |
output/bzip3-${{ matrix.target[0] }}*