-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (62 loc) · 2.21 KB
/
deploy.yaml
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
68
69
70
71
72
73
on:
workflow_dispatch:
workflow_call:
name: Deploy pharmr
jobs:
deploy:
runs-on: ubuntu-20.04
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout pharmr
uses: actions/checkout@v4
with:
path: pharmr_repo
- uses: ./pharmr_repo/.github/actions/setup-dependencies
- uses: ./pharmr_repo/.github/actions/setup-pharmr
with:
as-release: true
- uses: ./pharmr_repo/.github/actions/check-pharmr
- name: Get Pharmpy version
working-directory: pharmpy_repo
run: |
echo "pharmpy_version=`git describe --tags`" >> $GITHUB_ENV
shell: bash
- name: Set up git config
working-directory: pharmr_repo
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Add changes to DESCRIPTION and documentation
working-directory: pharmr_repo
run: |
git add DESCRIPTION
git add NAMESPACE
git add R/functions_wrapper.R
git add man/
git status
- name: Check if any files have been staged
working-directory: pharmr_repo
run: |
if [[ "$(git diff --name-only --cached | wc -c)" != "0" ]]; then
echo "has_been_updated=true" >> $GITHUB_ENV
else
echo "has_been_updated=false" >> $GITHUB_ENV
fi
- name: Commit and push changes, tag version
if: ${{ env.has_been_updated == 'true' }}
working-directory: pharmr_repo
run: |
echo "Committing changes"
git commit -m "Update DESCRIPTION/documentation"
echo "Tag version"
git tag "${{ env.pharmpy_version }}"
echo "Push changes"
git push https://$USERNAME:[email protected]/pharmpy/pharmr.git
echo "push tags"
git push --tags https://$USERNAME:[email protected]/pharmpy/pharmr.git
env:
REPO_KEY: ${{secrets.ACCESS_TOKEN}}
USERNAME: github-actions[bot]