diff options
Diffstat (limited to '.github/workflows/build-mac-binary.yaml')
-rw-r--r-- | .github/workflows/build-mac-binary.yaml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/build-mac-binary.yaml b/.github/workflows/build-mac-binary.yaml new file mode 100644 index 0000000..bfab295 --- /dev/null +++ b/.github/workflows/build-mac-binary.yaml @@ -0,0 +1,51 @@ +on: + workflow_dispatch: + +name: build-mac-binary + +jobs: + build-mac-binary: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("pkgbuild") + shell: Rscript {0} + + - name: Build Mac binary + run: pkgbuild::build(binary=TRUE, dest_path=".") + shell: Rscript {0} + + - name: Get binary name + id: getfilename + run: echo "::set-output name=file::$(ls *.tgz)" + + - name: Upload binary + uses: actions/upload-artifact@v1 + with: + name: ${{ steps.getfilename.outputs.file }} + path: ${{ steps.getfilename.outputs.file }} |