forked from rpodgorny/unionfs-fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (106 loc) · 3.37 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
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
name: Release
on:
push:
schedule:
# Run daily sanity check at 22:08 clock UTC
- cron: "8 22 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: macos-11
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- name: Install macfuse
run: |
# install header
wget https://github.com/macos-fuse-t/libfuse/archive/c91fefd0d1e6dee6f455b9c6c6e0290b6aa7a62a.zip
unzip c91fefd0d1e6dee6f455b9c6c6e0290b6aa7a62a.zip
rm -rf /usr/local/include/fuse
cp -r libfuse-c91fefd0d1e6dee6f455b9c6c6e0290b6aa7a62a/include /usr/local/include/fuse
# install fuse-t lib and binary
wget https://github.com/macos-fuse-t/fuse-t/releases/download/1.0.24/fuse-t-macos-installer-1.0.24.pkg
sudo installer -pkg fuse-t-macos-installer-1.0.24.pkg -target /
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: build
run: |
mkdir build
cd build
if [[ "${{matrix.arch}}" == "arm64" ]]; then
cmake -DWITH_LIBFUSE3=OFF -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk ..
else
cmake -DWITH_LIBFUSE3=OFF ..
fi
make
cp src/unionfs ../unionfs
cp src/unionfsctl ../unionfsctl
- name: store-artifacts
uses: actions/upload-artifact@v3
with:
name: unionfs-artifacts-darwin-${{ matrix.arch }}
path: |
unionfs
unionfsctl
prepare-tarball:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
os: [darwin]
needs: [build]
steps:
- name: download artifacts
uses: actions/download-artifact@v3
with:
name: unionfs-artifacts-${{ matrix.os }}-${{ matrix.arch }}
path: unionfs
- name: prepare release tarball
run: |
tag=$(echo $GITHUB_REF | sed 's/\//-/g')
tarball="unionfs-$tag-${{ matrix.os }}-${{ matrix.arch }}.tgz"
chmod +x unionfs/*
tar cf - unionfs | gzip > ${tarball}
echo "tarball=${tarball}" >> $GITHUB_ENV
shasum="$tarball.sha256sum"
sha256sum $tarball > $shasum
echo "tarball_shasum=${shasum}" >> $GITHUB_ENV
- name: store-artifacts
uses: actions/upload-artifact@v3
with:
name: unionfs-release-tarball
path: |
${{ env.tarball }}
${{ env.tarball_shasum }}
create-release:
runs-on: ubuntu-latest
needs: [prepare-tarball]
steps:
- name: download artifacts
uses: actions/download-artifact@v3
with:
name: unionfs-release-tarball
path: unionfs-tarball
- name: prepare release env
run: |
echo "tarballs<<EOF" >> $GITHUB_ENV
for I in $(ls unionfs-tarball);do echo "unionfs-tarball/${I}" >> $GITHUB_ENV; done
echo "EOF" >> $GITHUB_ENV
tag=$(echo $GITHUB_REF | sed 's/\//-/g')
echo "tag=${tag}" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: push release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
name: "unionfs ${{ env.tag }}"
body: |
unionfs for fuse-t
generate_release_notes: true
files: |
${{ env.tarballs }}