diff --git a/.github/workflows/build-models.yml b/.github/workflows/build_models.yml similarity index 79% rename from .github/workflows/build-models.yml rename to .github/workflows/build_models.yml index 3d1d0f9..e2a5214 100644 --- a/.github/workflows/build-models.yml +++ b/.github/workflows/build_models.yml @@ -143,48 +143,3 @@ jobs: name: geomodels-${{matrix.model_name}}-web-assets.tar.gz path: web_build/geomodels-${{matrix.model_name}}-web-assets.tar.gz if-no-files-found: error - build_backend: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install PDM - run: | - python -m pip install --upgrade pip - pip install pdm - - name: Install dependencies - run: | - # Remove old venv - pdm venv remove -y for-backend-build 2>/dev/null || pdm venv list - # Create new venv - pdm venv create --with-pip --name for-backend-build 3.10 - eval $(pdm venv activate for-backend-build) - pdm install --venv for-backend-build - - name: Make boreholes - run: | - eval $(pdm venv activate for-backend-build) - pushd web_build - ./make_boreholes.py -b batch.txt -d query_data.db boreholes - tar cvfz boreholes.tar.gz ./boreholes - popd - - name: Upload borehole data - uses: actions/upload-artifact@v4 - with: - name: boreholes.tar.gz - path: web_build/boreholes.tar.gz - if-no-files-found: error - - name: Make API directory - run: | - pushd web_build - ./build_api_dir.sh boreholes/query_data.db - popd - - name: Upload API directory - uses: actions/upload-artifact@v4 - with: - name: api.tar.gz - path: web_build/api.tar.gz - if-no-files-found: error diff --git a/.github/workflows/release_backend.yml b/.github/workflows/release_backend.yml new file mode 100644 index 0000000..730649b --- /dev/null +++ b/.github/workflows/release_backend.yml @@ -0,0 +1,26 @@ +# Release backend from the latest successful build action into a certain release +name: Release backend api and borehole db + +on: + push: + tags: + - "PORTAL_RELEASE_*" + +jobs: + do-release: + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build_backend.yml + workflow_conclusion: success + branch: master + - name: Add to release + uses: softprops/action-gh-release@v2 + with: + name: Source and web asset release based on tag ${{github.ref}} + files: | + api.tar.gz + boreholes.tar.gz + fail_on_unmatched_files: true diff --git a/.github/workflows/release.yml b/.github/workflows/release_models.yml similarity index 95% rename from .github/workflows/release.yml rename to .github/workflows/release_models.yml index c5e28ed..d0a7fcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release_models.yml @@ -17,7 +17,7 @@ jobs: - name: Download artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: build-models.yml + workflow: build_models.yml workflow_conclusion: success branch: master - name: Add to release