Skip to content

Commit

Permalink
build macos binary on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoAhoy committed Aug 25, 2021
1 parent c0c7271 commit 457ad68
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
os: [ubuntu-18.04, macos-latest]

steps:
- name: Checkout Github Repository
Expand All @@ -18,34 +18,60 @@ jobs:
- name: Get JuiceFS Version
id: jfs-version
run: echo "::set-output name=JUICEFS_VERSION::$(make -s print_libjfs_version)"
- name: Cache juicefs and libjfs binary

- name: Cache juicefs and libjfs binary linux/windows
uses: actions/cache@v2
id: jfs-cache
id: jfs-cache-win-linux
with:
path: |
./juicefs/lib/libjfs.so
./juicefs/lib/libjfs.dll
./juicefs/lib/juicefs
./juicefs/lib/juicefs.exe
key: jfs-binary-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
key: ${{ matrix.os }}-jfs-binary-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
- name: Cache juicefs and libjfs mac
uses: actions/cache@v2
id: jfs-cache-mac
with:
path: |
./juicefs/lib/libjfs.so
./juicefs/lib/libjfs.dll
key: ${{ matrix.os }}-jfs-binary-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}

- name: Run build-libjfs
if: steps.pip-cache.outputs.cache-hit != 'true'

- name: Run build-libjfs linux and windows
if: ${{ matrix.os == 'ubuntu-18.04' && steps.jfs-cache-win-linux.outputs.cache-hit != 'true' }}
run: |
make build_libjfs_so
make build_libjfs_dll
- name: Run build-libjfs macos
if: ${{ matrix.os == 'macos-latest' && steps.jfs-cache-mac.outputs.cache-hit != 'true' }}
run: |
make build_libjfs_so
- name: Upload windows jfs binary
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v2
with:
name: jfs-binary-win-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
path: |
./juicefs/lib/libjfs.dll
./juicefs/lib/juicefs.exe
retention-days: 1
- name: Upload linux/mac jfs binary
- name: Upload linux jfs binary
if: matrix.os == 'ubuntu-18.04'
uses: actions/upload-artifact@v2
with:
name: jfs-binary-linux-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
path: |
./juicefs/lib/libjfs.so
./juicefs/lib/juicefs
retention-days: 1
- name: Upload macos jfs binary
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v2
with:
name: jfs-binary-linux-mac-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
name: jfs-binary-mac-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
path: |
./juicefs/lib/libjfs.so
./juicefs/lib/juicefs
Expand All @@ -65,6 +91,7 @@ jobs:
# pip-path: /opt/hostedtoolcache/Python
# libjfs-path: /opt/hostedtoolcache/Golang
- os: macos-latest
os-key: mac
pip-path: /Users/runner/hostedtoolcache/Python
libjfs-path: /Users/runner/hostedtoolcache/Golang
# - os: windows-latest
Expand Down Expand Up @@ -103,7 +130,7 @@ jobs:
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/download-artifact@v2
with:
name: jfs-binary-linux-mac-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
name: jfs-binary-${{ matrix.os-key }}-${{ steps.jfs-version.outputs.JUICEFS_VERSION }}
path: ./juicefs/lib/

- name: Run style-check
Expand Down

0 comments on commit 457ad68

Please sign in to comment.