From 593ee5655357e954145a2a15412e4da36fd37594 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Mon, 24 Feb 2025 16:11:26 +1300 Subject: [PATCH] github actions release --- .github/workflows/create-release.yaml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/create-release.yaml diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml new file mode 100644 index 0000000..ec3b4fa --- /dev/null +++ b/.github/workflows/create-release.yaml @@ -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 }}