-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
470d75d
commit 695ae10
Showing
1 changed file
with
5 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,62 +5,22 @@ on: | |
name: Deploy pharmr | ||
|
||
jobs: | ||
check-pharmr: | ||
uses: pharmpy/pharmr/.github/workflows/main.yaml@main | ||
with: | ||
as-release: true | ||
|
||
deploy: | ||
runs-on: ubuntu-20.04 | ||
needs: check-pharmr | ||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Download pharmr repo artifact | ||
uses: actions/download-artifact@master | ||
- uses: pharmpy/pharmr/.github/workflows/main.yaml@main | ||
with: | ||
name: pharmr_repo | ||
path: pharmr_repo | ||
as-release: true | ||
|
||
- 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: Check repo | ||
run: pwd | ||
|
||
- name: Add changes to DESCRIPTION and documentation | ||
- name: Set up git config | ||
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 "${{ needs.check-pharmr.outputs.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] |