Skip to content

fix runner_target

fix runner_target #8

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
tags:
- "**" # Push events to every tag including hierarchical tags like v1.0/beta
workflow_dispatch:
name: Release_cross_compiled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RPOLARS_FULL_FEATURES: "true"
RPOLARS_CARGO_CLEAN_DEPS: "true"
RPOLARS_PROFILE: release-optimized
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (target - ${{ matrix.config.target }})
permissions:
contents: write
strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release', target: 'x86_64-apple-darwin'}
- {os: macos-latest, r: 'release', target: 'aarch64-apple-darwin'}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Fix path for Windows caching
if: runner.os == 'Windows'
shell: bash
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
rtools-version: ${{ matrix.config.rtools-version }}
Ncpus: 2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: dev
pak-version: devel
env:
CI: false
- name: cross compile
run: |
pwd
make requirements-rs
rustup target add "$RUNNER_TARGET"
cargo build --lib --profile release-optimized --target "$RUNNER_TARGET" --manifest-path=./src/rust/Cargo.toml
mv ./src/rust/target/"$RUNNER_TARGET"/release-optimized/libr_polars.a ./inst/
ls -l
ls ./inst/ -l
env:
RUNNER_TARGET: "${{ matrix.config.target }}"
shell: bash
- name: build source (with object file)
run: |
runner_target <- Sys.getenv("RUNNER_TARGET")
fn = devtools::build(vignettes = FALSE)
newfn = paste0(substr(fn,1,regexpr("_",fn)),"cross_",runner_target,".tar.gz")
file.rename(fn, newfn)
shell: Rscript {0}
env:
RUNNER_TARGET: "${{ matrix.config.target }}"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
files: |
../polars_cross_*
- name: print files
run: print(list.files("..",recursive = TRUE,full.names=TRUE))
shell: Rscript {0}
- name: print wd
run: print(getwd())
shell: Rscript {0}