ci: bump version gh action (node 20) #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build plugin | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Override plugin version for branch, default is short commit hash' | |
| required: false | |
| type: string | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.9' | |
| - name: Build plugin zip artifact | |
| id: build | |
| run: | | |
| # makeBuild | |
| # USAGE: ./makeBuild.sh $VERSION $folder_suffix | |
| VERSION="${{ inputs.version }}" | |
| if [[ "$GITHUB_REF_TYPE" == "branch" && "$GITHUB_EVENT_NAME" == "push" ]]; then | |
| sha_short=$(git rev-parse --short HEAD) | |
| VERSION=$sha_short | |
| folder_suffix=DEV | |
| else | |
| VERSION=${VERSION:-"$GITHUB_REF_NAME"} | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "old_file_name=xyz-qgis-plugin-$VERSION" >> $GITHUB_OUTPUT | |
| echo "old_zip_name=QGIS-XYZ-Plugin-$VERSION" >> $GITHUB_OUTPUT | |
| chmod +x ./makeBuild.sh | |
| ./makeBuild.sh $VERSION $folder_suffix | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: QGIS-XYZ-Plugin-${{ steps.build.outputs.version }}.zip | |
| path: build/XYZHubConnector-${{ steps.build.outputs.version }}.zip | |
| archive: false | |
| - name: Upload artifacts DEV | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: QGIS-XYZ-Plugin-DEV${{ steps.build.outputs.version }}.zip | |
| path: build/XYZHubConnector_DEV-${{ steps.build.outputs.version }}.zip | |
| archive: false | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: | | |
| build/*.zip |