github actions release

This commit is contained in:
Tom Elliott 2025-02-24 16:11:26 +13:00
parent 58a6b7a9f1
commit 593ee56553

33
.github/workflows/create-release.yaml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Releases
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: latest
- name: create_body
run: |
news <- readLines('NEWS.md')
i <- grep("^# ts", news)[1:2]
if (is.na(i[2])) i[2L] <- length(news) + 1L
news <- news[(i[1L] + 1L):(i[2L] - 1L)]
news <- news[trimws(news) != ""]
writeLines(news, "body.md")
shell: Rscript {0}
- uses: ncipollo/release-action@v1
with:
bodyFile: "body.md"
token: ${{ secrets.GITHUB_TOKEN }}