Skip to content

📦 Release

📦 Release #51

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.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 --profile qgis --profile schemaspy up --build -d
docker compose exec signalo init_db.sh wait
- name: create dumps
run: |
export SOURCE_DIR=$(pwd)
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
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: |
sed -i "s/version dev/version ${{ github.event.release.tag_name }}/" data_model/schemaspy.properties
docker compose run schemaspy
zip -r signalo-${{ github.event.release.tag_name }}-model-documentation.zip datamodel/schemaspy/*
- 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