-
Notifications
You must be signed in to change notification settings - Fork 13
37 lines (34 loc) · 1.09 KB
/
release-database.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
name: "Automatic release with database"
on:
push:
branches: [ "master" ]
tags: [ "v*.*.*" ]
paths: [ "database/**" ]
# Actions
# softprops/action-gh-release@v1 https://github.com/softprops/action-gh-release
jobs:
publish:
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: Install dependencies running on nektos/act
if: github.actor == 'nektos/act'
run: |
apt-get update -y -qq
apt-get install -y -qq sqlite3 bzip2
- name: "Package information"
id: package_info
run: echo "version=v$(cat database/version.txt)" >> $GITHUB_OUTPUT
- name: "Create database"
run: cat database/schemas/*.sql database/data/*.sql | sqlite3 catalogs.db
- name: "Compress database"
run: bzip2 catalogs.db
- name: "Publish release"
if: github.actor != 'nektos/act'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.package_info.outputs.version }}
files: catalogs.db.bz2