Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LKajan committed Feb 2, 2024
1 parent 68545a0 commit e88d865
Show file tree
Hide file tree
Showing 26 changed files with 1,954 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Publish

on:
pull_request:
branches: [main]
types: [closed]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
build:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install hatch
run: |
pip install --upgrade pip
pip install hatch
- name: Get version info
id: version
run: echo "version=$(hatch version)" >> "$GITHUB_OUTPUT"

- name: Build distribution
run: hatch build

- name: upload distribution
uses: actions/upload-artifact@v4
with:
name: build
path: |
dist/*
src/qgis_venv_creator/create_qgis_venv.py
outputs:
version: ${{ steps.version.outputs.version }}

release:
name: Create a Github release
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download distribution
uses: actions/download-artifact@v4
with:
name: build

- name: Create release
uses: softprops/action-gh-release@v1
with:
name: "Release ${{ needs.build.outputs.version }}"
tag_name: "v${{ needs.build.outputs.version }}"
files: |
dist/*
src/qgis_venv_creator/create_qgis_venv.py
publish:
name: Publish to PyPI
needs: [build]
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
runs-on: ubuntu-latest
steps:
- name: Download distribution
uses: actions/download-artifact@v4
with:
name: build

- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
54 changes: 54 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Prepare a Release

on:
workflow_dispatch:
inputs:
version:
description: "Version bump"
required: true
default: "minor"
type: choice
options:
- major
- minor
- patch

jobs:
update-version:
name: Update version and changelog
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Update the version
id: version
run: |
python -m pip install --upgrade pip
pip install hatch
hatch version ${{ github.event.inputs.version }}
echo "version=$(hatch version)" >> "$GITHUB_OUTPUT"
- uses: EndBug/add-and-commit@v9
with:
message: "Bump version to ${{ steps.version.outputs.version }}"
push: false

- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/${{ steps.version.outputs.version }}
title: "Prepare release ${{ steps.version.outputs.version }}"
body: "Bump the version to ${{ steps.version.outputs.version }}."
base: main
labels: release
assignees: ${{ github.actor }}
Loading

0 comments on commit e88d865

Please sign in to comment.