-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.62 KB
/
main.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
name: Github Action
on: [push, pull_request]
jobs:
test:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Install python version
uses: gabrielfalcao/pyenv-action@v7
with:
default: 3.9.0
command: pip install -U pip # upgrade pip after installing python
- name: create environment
run: pyenv local 3.9.0 && python -mvenv .venv390
- name: Install dependencies
run: |
pip install -r requirements.txt --upgrade pip
pip install pytest
- name: Run tests
run: pytest
release:
name: Create Release
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v2
- id: set_var
run: |
content=`cat ./datapackage.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
- run: |
echo "VERSION=${{fromJson(steps.set_var.outputs.packageJson).version}}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
body: Scenario update
draft: false
prerelease: false