forked from Cyberwatch/HashThePlanet
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.26 KB
/
db-release.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
# This workflow updates the database and creates a release of it everyday
name: Release Workflow
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
inputs:
overwrite:
description: Create a new release without using the database from the last one
type: boolean
required: true
default: "false"
push:
branches:
- main
paths:
- 'src/tech_list.json'
jobs:
db-release:
name: "Database Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install --no-deps -r requirements.txt
pip install --no-deps .
pip install pylint pytest
- name: "Download the latest published database"
if: ${{ github.event.inputs.overwrite == 'false' }}
uses: "robinraju/release-downloader@v1.2"
continue-on-error: true
with:
repository: "Cyberwatch/HashThePlanet"
latest: true
fileName: "hashtheplanet.db"
tarBall: false
zipBall: false
out-file-path: "dist/"
- name: "Update the database"
run: |
hashtheplanet --input src/tech_list.json --output dist/hashtheplanet.db
- name: "Publish the daily release with the tag: ${{ steps.date.outputs.date }}"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.date.outputs.date }}"
prerelease: false
title: "Database release: ${{ steps.date.outputs.date }}"
files: |
dist/hashtheplanet.db
- name: "Publish the daily release with the tag: latest"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Database release: Latest"
files: |
dist/hashtheplanet.db