Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
sciome-bot committed Jan 12, 2024
1 parent c84e159 commit f83df2b
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

name: Release New version

on:
push:
tags:
- '*'
branches: ["build-workflow"]
workflow_dispatch:

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
build_upload_artefacts:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
# - {os: windows-latest, r: '4.2'}
# - {os: ubuntu-latest, r: '4.2'}
# - {os: macos-latest, r: '4.2'}
env:
R_KEEP_PKG_SOURCE: yes
steps:
# see this for details: https://msmith.de/2020/03/12/r-cmd-check-github-actions.html
- name: Configure git
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
any::ggplot2
any::rcmdcheck
any::roxygen2
needs: |
check
roxygen2
- name: Read VERSION file
if: runner.os != 'macOs'
id: getversion
shell: bash
run: |
echo "VERSION=$(cat DESCRIPTION | grep -Po '(?<=Version\:\s).*')" >> $GITHUB_OUTPUT
- name: Read VERSION file (macOS)
if: runner.os == 'macOs'
id: getversion_mac
run: |
echo "VERSION=$(sed -n 's/Version:[[:space:]]*//p' DESCRIPTION | tr -d '[:space:]')" >> $GITHUB_OUTPUT
- name: Build package (Windows)
if: runner.os == 'Windows'
shell: cmd
run: R CMD build .
- name: Build package
if: runner.os == 'Linux' || runner.os == 'macOs'
run: R CMD build .
- name: Test Install (Windows)
if: runner.os == 'Windows'
shell: cmd
run: R CMD INSTALL --build PrestoGP_${{ steps.getversion.outputs.VERSION }}.tar.gz
- name: Test Install (Linux)
if: runner.os == 'Linux'
run: R CMD INSTALL --build PrestoGP_${{ steps.getversion.outputs.VERSION }}.tar.gz
- name: Test Install (macOs)
if: runner.os == 'macOs'
run: R CMD INSTALL --build PrestoGP_${{ steps.getversion_mac.outputs.VERSION }}.tar.gz
- uses: svenstaro/upload-release-action@v2
if: runner.os == 'macOs'
with:
tag: ${{ github.ref }}
file: PrestoGP_${{ steps.getversion_mac.outputs.VERSION }}.tgz
asset_name: "PrestoGP_${{ steps.getversion_mac.outputs.VERSION }}-x86_64-macOs-R.${{ matrix.config.r }}.tgz"
- uses: svenstaro/upload-release-action@v2
if: runner.os == 'Linux'
with:
tag: ${{ github.ref }}
file: "PrestoGP_${{ steps.getversion.outputs.VERSION }}_R_x86_64-pc-linux-gnu.tar.gz"
asset_name: PrestoGP_${{ steps.getversion.outputs.VERSION }}-x86_64-linux-R.${{ matrix.config.r }}.zip
- uses: svenstaro/upload-release-action@v2
if: runner.os == 'Windows'
with:
tag: ${{ github.ref }}
file: PrestoGP_${{ steps.getversion.outputs.VERSION }}.zip
asset_name: PrestoGP_${{ steps.getversion.outputs.VERSION }}-windows-R.${{ matrix.config.r }}.zip

0 comments on commit f83df2b

Please sign in to comment.