-
Notifications
You must be signed in to change notification settings - Fork 4
103 lines (88 loc) · 2.95 KB
/
check_version_changed.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This workflow checks if the content of the original databases
# has changed. If this is the case a new release is produced.
name: Check version changed
on:
schedule:
# set schedule date
- cron: '00 22 01 * *'
workflow_dispatch:
jobs:
# This workflow contains two jobs called search and build
search:
name: Search Database
# search for differences to the origianl databases
runs-on: ubuntu-latest
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so our job can access it
- name: Checkout code
id: checkout_code
uses: actions/checkout@v2
# Installs python dependencies
- name: Python dependencies
id: python_dependencies
run: pip install pandas xlrd xlsx2csv
# Runs a python script searching for new changes in the database
- name: Create CSV
id: create_knotinfo_csv
run: ./create_knotinfo_csv.py
# Runs a shell script to push a new version to the repository if necessary
- name: New version tag
id: new_version_tag
run: ./new_version_tag.sh > new_version_tag.out
build:
needs: search
name: Create Releases
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so our job can access it
- name: Checkout code
uses: actions/checkout@v2
# Setting the tag name
- name: Set tag name
id: set_tag_name
run: |
git pull
TAG=`./get_release_tag.sh`
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
# Create GitHub release
- name: Create GitHub Release
id: create_github_release
if: ${{ env.TAG_NAME != '' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release ${{ env.TAG_NAME }}
body: |
Changes in this Release
- Automatically generated Release according to changes in the original databases
- See the web-sites of KnotInfo and LinkInfo for more information
draft: false
prerelease: false
# Create PyPI release
- name: Set up Python 3.7
if: ${{ env.TAG_NAME != '' }}
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
if: ${{ env.TAG_NAME != '' }}
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
if: ${{ env.TAG_NAME != '' }}
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to PyPI
if: ${{ env.TAG_NAME != '' }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}