-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (56 loc) · 2.25 KB
/
release-R.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Release of R package
on:
workflow_dispatch:
inputs:
type:
description: 'New version type [major | minor | patch]'
required: true
default: 'patch'
jobs:
bumpVersion:
runs-on: ${{ vars.RUNNER_UBUNTU }}
steps:
- run: |
echo "New version type: ${{ inputs.type }}"
- name: Setup checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_TOKEN }}
- name: Config git
run: |
git config --local user.email "${{ vars.PA_BOT_EMAIL }}"
git config --local user.name "${{ vars.PA_BOT_NAME }}"
git config pull.rebase true
- name: Checkout master
run: git checkout master && git pull --tags
- name: Generate new version
id: release_version
uses: zwaldowski/semver-release-action@v4
with:
dry_run: true
bump: ${{ inputs.type }}
prefix: v
github_token: ${{ secrets.GH_RELEASE_TOKEN }}
- name: Update with the release version
run: |
CURRENT_VERSION=$(grep Version DESCRIPTION | sed 's/Version: \(.*\).9000/\1/g')
sed -i -E "s/$CURRENT_VERSION/${{ steps.release_version.outputs.version }}/g" README.md
sed -i -E 's/Version: .*/Version: ${{ steps.release_version.outputs.version }}/g' DESCRIPTION
- name: Commit with the release version
run: |
git add README.md
git add DESCRIPTION
git commit -m "chore(release): set the release version to ${{ steps.release_version.outputs.version }}"
- name: Tag ${{ steps.release_version.outputs.version }}
run: |
git tag -a ${{ steps.release_version.outputs.version_tag }} -m "chore(release): ${{ steps.release_version.outputs.version }}"
- name: Update with the development version
run: |-
sed -i -E 's/Version: .*/Version: ${{ steps.release_version.outputs.version }}.9000/g' DESCRIPTION
- name: Commit with the development version
run: |
git add DESCRIPTION
git commit -m "chore(release): set the development version to ${{ steps.release_version.outputs.version }}.9000"
- name: Push commits and tags
run: |
git push && git push --tags