-
Notifications
You must be signed in to change notification settings - Fork 12
67 lines (64 loc) · 2.15 KB
/
build_conda.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
name: mambabuild
on:
push:
branches:
- main
env:
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
recipe_path: conda/recipe
env_yml_path: conda/env/yml
VERSION: '2.0.0' # versioned by bump2version
jobs:
build_conda_pkgs:
# When merging to one of the branches above and the commit message matches
if: "startsWith(github.event.head_commit.message, 'Bump version:')"
name: Build conda package
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Micromamba setup
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.env_yml_path }}/condabuild_env.yml
- name: 🐍 Conda pkg build and upload
run: |
conda mambabuild ${recipe_path}/cpsr -c pcgr -c conda-forge -c bioconda --token ${atoken}
- name: 🔖 Tag creation
uses: actions/github-script@v7
with:
script: |
const the_tag_name = 'refs/tags/v' + process.env.VERSION
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: the_tag_name,
sha: context.sha
})
pkgdown_site:
# only build pkgdown site on main
if: github.ref_name == 'main'
name: Deploy pkgdown website
runs-on: ubuntu-latest
needs: build_conda_pkgs
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Micromamba setup
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.env_yml_path }}/pkgdown.yml
- name: Publish pkgdown website
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
micromamba activate pkgdown
printf "cpsr version:\n"
Rscript -e "packageVersion('cpsr')"
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = 'Built CPSR website: https://sigven.github.io/cpsr/', branch = 'gh-pages', new_process = FALSE)"