install Rcpp Pt.2 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build R packages repository | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - 'r-packages/**' | |
| - '.github/workflows/r-packages.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build-source: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qpdf texinfo texlive-latex-base texlive-latex-extra | |
| - name: Install R package dependencies | |
| run: | | |
| install.packages(c("Rcpp"), repos="https://cloud.r-project.org") | |
| shell: Rscript {0} | |
| - name: Build source packages | |
| run: | | |
| mkdir -p r-packages/src/contrib | |
| for pkg in r-packages/*/ ; do | |
| if [ -d "$pkg" ]; then | |
| R CMD build "$pkg" --no-build-vignettes | |
| fi | |
| done | |
| mv *.tar.gz r-packages/src/contrib/ | |
| - name: Create PACKAGES files | |
| run: | | |
| Rscript -e 'tools::write_PACKAGES("r-packages/src/contrib", type="source")' | |
| build-binaries: | |
| needs: build-source | |
| strategy: | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| include: | |
| - os: windows-latest | |
| platform: win.binary | |
| path: bin/windows/contrib/4.3 | |
| - os: macos-latest | |
| platform: mac.binary | |
| path: bin/macosx/contrib/4.3 | |
| - os: ubuntu-latest | |
| platform: binary | |
| path: bin/linux/contrib/4.3 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| - name: Install system dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install qpdf | |
| brew install --cask basictex | |
| - name: Install system dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install rtools | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qpdf texinfo texlive-latex-base texlive-latex-extra | |
| - name: Install R package dependencies | |
| run: | | |
| install.packages(c("Rcpp"), repos="https://cloud.r-project.org") | |
| shell: Rscript {0} | |
| - name: Build binary packages | |
| run: | | |
| mkdir -p r-packages/${{ matrix.path }} | |
| for pkg in r-packages/*/ ; do | |
| if [ -d "$pkg" ]; then | |
| R CMD INSTALL --build "$pkg" --no-multiarch | |
| fi | |
| done | |
| mv *.zip *.tgz r-packages/${{ matrix.path }}/ | |
| - name: Create PACKAGES files | |
| run: | | |
| Rscript -e 'tools::write_PACKAGES("r-packages/${{ matrix.path }}", type="${{ matrix.platform }}")' | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: r-packages-${{ matrix.os }} | |
| path: r-packages | |
| deploy: | |
| needs: [build-source, build-binaries] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v3 | |
| with: | |
| path: artifacts | |
| - name: Merge repositories | |
| run: | | |
| mkdir -p r-packages-merged | |
| cp -r artifacts/*/* r-packages-merged/ | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./r-packages-merged | |
| destination_dir: r-packages |