-
-
Notifications
You must be signed in to change notification settings - Fork 4
98 lines (82 loc) · 4.4 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
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.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: |
docker compose --profile qgis --profile schemaspy up --build -d
docker compose exec signalo init_db.sh wait
- name: create dumps
run: |
docker compose exec 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 signalo pg_dump --format plain --exclude-schema=public --file signalo-${{ github.event.release.tag_name }}-db-dump.sql signalo
docker compose exec signalo pg_dump --format plain --schema=signalo_app --file signalo-${{ github.event.release.tag_name }}-db-app.sql signalo
docker compose exec signalo init_db.sh build -d
docker compose exec 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 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
docker compose run qgis sh -c '/usr/src/project/scripts/project-translation-compile.sh /usr/src/project/signalo.qgs'
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 datamodel/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 datamodel/changelogs
- name: schemaspy
run: |
sed -i "s/version dev/version ${{ github.event.release.tag_name }}/" datamodel/schemaspy.properties
docker compose run schemaspy
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@v2
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