Build R for Windows Installers #5
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
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| release: | |
| description: Publish a new stable version | |
| type: boolean | |
| default: false | |
| required: false | |
| name: Build R for Windows Installers | |
| permissions: | |
| contents: write | |
| jobs: | |
| windows: | |
| name: Windows R-${{matrix.version}}-${{matrix.arch}} | |
| runs-on: ${{matrix.arch == 'aarch64' && 'windows-11-arm' || 'windows-latest'}} | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [ 'devel', 'next', '4.6.1' ] | |
| arch: [ 'x86_64', 'aarch64'] | |
| steps: | |
| - name: Download R Source | |
| uses: r-devel/actions/get-r-source@main | |
| with: | |
| version: ${{matrix.version}} | |
| - name: Setup Build Tooling | |
| uses: r-devel/actions/setup-windows-tools@main | |
| - name: Build R-base | |
| uses: r-devel/actions/build-r-windows@main | |
| - name: Rename and Test Installer | |
| run: | | |
| Get-Item "src/gnuwin32/installer/R-*-win.exe" | Rename-Item -NewName { $_.Name -replace 'win\.exe$', '${{matrix.arch }}.exe' } | |
| .\src\gnuwin32\installer\R-*.exe /SILENT | |
| shell: powershell | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: R-${{matrix.version}}-${{matrix.arch}} | |
| path: src/gnuwin32/installer/R-*.exe | |
| - name: Release | |
| uses: softprops/action-gh-release@v3 | |
| if: inputs.release || matrix.version == 'devel' || matrix.version == 'next' | |
| with: | |
| tag_name: ${{ matrix.version }} | |
| files: src/gnuwin32/installer/R-*.exe | |
| keep-alive: | |
| runs-on: ubuntu-latest | |
| needs: windows | |
| if: always() | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Update activity timestamp | |
| run: | | |
| git checkout -B activity-log | |
| mkdir -p .github | |
| date > .github/last-run.txt | |
| git add .github/last-run.txt | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git commit -m "Update activity timestamp [skip ci]" | |
| git push origin activity-log --force |