-
-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (90 loc) · 4.88 KB
/
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
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
name: Release
on:
release:
types: [published]
jobs:
release:
name: Create release
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
DOCKER_TAG: stable
COMPOSE_FILE: .docker/docker-compose.qgis.yml
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Transifex
run: |
curl -OL https://github.com/transifex/cli/releases/download/v1.6.5/tx-linux-amd64.tar.gz
tar -xvzf tx-linux-amd64.tar.gz
- name: Set version
run: echo ${{ github.event.release.tag_name }} > CURRENT_VERSION.txt
- name: Docker build
run: |
export SOURCE_DIR=$(pwd)
docker compose up --build -d
docker compose exec -T signalo init_db.sh wait
- name: create dumps
run: |
export SOURCE_DIR=$(pwd)
docker compose exec -T signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump.backup signalo
docker compose exec -T signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump.sql signalo
docker compose exec -T signalo pg_dump --format plain --schema=signalo_app --file signalo-${{ github.event.release.tag_name }}-db-app.sql signalo
docker compose exec -T signalo init_db.sh build -d
docker compose exec -T signalo pg_dump --format custom --exclude-schema=public --blobs --compress 5 --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.backup signalo
docker compose exec -T signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.sql signalo
- name: translate project
run: |
./tx pull -a
export SOURCE_DIR=$(pwd)
docker compose run qgis sh -c 'xvfb-run /usr/src/scripts/project-translation-compile.sh'
rm project/signalo_*.ts # do not package ts files
- name: set project version + create project archive
run: |
sed -i 's|<title>Signalo - Demo</title>|<title>Signalo - v${{ github.event.release.tag_name }}</title>|' project/signalo.qgs
sed -i 's|projectname="Signalo - Demo"|projectname="Signalo - v${{ github.event.release.tag_name }}"|' project/signalo.qgs
sed 's/pg_signalo/pg_signalo_dev/g' project/signalo.qgs > project/signalo_dev.qgs
sed 's/pg_signalo/pg_signalo_prod/g' project/signalo.qgs > project/signalo_prod.qgs
cp data_model/demo_data/this-is-the-way.jpg project/this-is-the-way.jpg
zip -r signalo-${{ github.event.release.tag_name }}-project.zip project README.md
- name: "zip changelogs"
run: |
zip -r signalo-${{ github.event.release.tag_name }}-changelogs.zip data_model/changelogs
- name: SchemaSpy
run: |
sudo apt-get install -y openjdk-8-jdk graphviz
wget https://github.com/schemaspy/schemaspy/releases/download/v6.1.0/schemaspy-6.1.0.jar
wget https://jdbc.postgresql.org/download/postgresql-42.2.24.jar -O postgresql.jar
java -jar schemaspy-6.1.0.jar -t pgsql -db signalo -u postgres -host localhost -p postgres \
-schemas signalo_db,signalo_app -norows \
-hq -o model-documentation -dp postgresql.jar \
-desc "signalo data model documentation (version ${{ github.event.release.tag_name }})"
zip -r signalo-${{ github.event.release.tag_name }}-model-documentation.zip model-documentation/*
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "push to dockerhub"
if: github.event_name != 'pull_request'
run: |
docker push opengisch/signalo:stable
docker tag opengisch/signalo:stable opengisch/signalo:${{ github.event.release.tag_name }}
docker push opengisch/signalo:${{ github.event.release.tag_name }}
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
signalo-${{ github.event.release.tag_name }}-project.zip
signalo-${{ github.event.release.tag_name }}-changelogs.zip
signalo-${{ github.event.release.tag_name }}-model-documentation.zip
signalo-${{ github.event.release.tag_name }}-db-dump.backup
signalo-${{ github.event.release.tag_name }}-db-dump.sql
signalo-${{ github.event.release.tag_name }}-db-app.sql
signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.backup
signalo-${{ github.event.release.tag_name }}-db-dump-with-demo.sql
rebuild-website:
uses: ./.github/workflows/website.yml
secrets: inherit
needs: release