-
Notifications
You must be signed in to change notification settings - Fork 15
64 lines (60 loc) · 2.15 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
test:
name: Pass tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: dummy test passing
run:
python ./pass_tests.py
deploy:
name: Deploy to GitHub and PyPI
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: set up node # we need node for for semantic release
uses: actions/setup-node@v2.1.2
with:
node-version: 14.17.0
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ci-requirements.txt
- name: install semantic-release
run:
npm install @semantic-release/exec
- name: run semantic release
id: new_release
run: |
nextRelease="`npx semantic-release@^17.0.0 --dryRun | grep -oP 'Published release \K.*? ' || true`"
npx semantic-release@^17.0.0
echo "::set-output name=tag::$nextRelease"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
- name: sleep for 3 minutes for PyPI update
if: contains(steps.new_release.outputs.tag, '.')
run: sleep 180s
shell: bash
- name: Update ladybug-tools-installer
if: contains(steps.new_release.outputs.tag, '.')
env:
DISPATCH_REPO: pollination/ladybug-tools-installer
DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }}
run: |
curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-d '{"event_type": "lbt_grasshopper_release", "client_payload": {"version": "${{ steps.new_release.outputs.tag }}"}}' \
-u ladybugbot:$DEPS_TOKEN