Skip to content

📦 Release

📦 Release #48

Workflow file for this run

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