Skip to content

Merge pull request #564 from kartoza/release-v0.2.7 #26

Merge pull request #564 from kartoza/release-v0.2.7

Merge pull request #564 from kartoza/release-v0.2.7 #26

Workflow file for this run

name: Create a release
on:
push:
tags:
- "v*"
jobs:
create-release:
runs-on: ubuntu-22.04
container:
image: qgis/qgis:release-3_34
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fix Python command
run: apt-get install python-is-python3
- name: Install python
uses: actions/setup-python@v4
- name: Install plugin dependencies
run: pip install -r requirements-dev.txt
- name: Get experimental info
id: get-experimental
run: |
echo "::set-output name=IS_EXPERIMENTAL::$(python -c "import json; f = open('config.json'); data=json.load(f); print(str(data['general']['experimental']).lower())")"
- name: Create release from tag
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: ${{ steps.get-experimental.outputs.IS_EXPERIMENTAL }}
draft: false
- name: Generate zip
run: python admin.py generate-zip
- name: get zip details
id: get-zip-details
run: |
echo "::set-output name=ZIP_PATH::dist/$(ls dist)\n"
echo "::set-output name=ZIP_NAME::$(ls dist)"
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url}}
asset_path: ${{ steps.get-zip-details.outputs.ZIP_PATH}}
asset_name: ${{ steps.get-zip-details.outputs.ZIP_NAME}}
asset_content_type: application/zip
- name: Checkout code
uses: actions/checkout@v2
with:
ref: release
- name: Update custom plugin repository to include latest release
run: |
echo "$(python admin.py generate-plugin-repo-xml)" >> docs/repository/plugins.xml
python admin.py --verbose generate-plugin-repo-xml
echo " " >> docs/repository/plugins.xml
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory /__w/GEEST2/GEEST2
git add -A
git commit -m "Update on plugins.xml"
git push origin release