-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (99 loc) · 2.83 KB
/
create-release-and-deploy.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
104
105
106
107
108
109
110
111
112
113
name: Create release and deploy FluMutDB
run-name: ${{ github.actor }} is releasing ${{ github.ref }}
on:
push:
tags:
- "v.*"
jobs:
build:
name: Build FluMutDB
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build SQLite DB
run: |
mkdir -p src/flumutdb/
touch src/flumutdb/__init__.py
cat flumut_db.sql | sqlite3 src/flumutdb/flumut_db.sqlite
sqlite3 src/flumutdb/flumut_db.sqlite "SELECT major || '.' || minor FROM db_version" >version.txt
- name: Upload sqlite DB
uses: actions/upload-artifact@v4
with:
name: db
path: src/flumutdb/flumut_db.sqlite
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build FluMutDB
run: python -m build
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
if-no-files-found: error
release:
name: Create release on GitHub
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build]
steps:
- name: Download db
uses: actions/download-artifact@v4
with:
name: db
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
flumut_db.sqlite
dist/*
update_docs:
name: Update FluMut documentation with new markers
runs-on: ubuntu-latest
needs: [release]
environment: FluMutPagesTrigger
steps:
- name: variables
run: |
repo_owner="izsvenezie-virology"
repo_name="FluMut"
event_type="trigger-update-markers"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"unit\": false, \"integration\": true}}"
pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment: pypi-release
needs: release
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1