Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluginin julkaisun automatisointi #63

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
enhancement:
- head-branch: ["^feature/"]

bug:
- head-branch: ["^fix/"]

internal:
- head-branch: ["^chore/"]
50 changes: 50 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name-template: "$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"

template: |
## Muutokset

$CHANGES

**Yksityiskohtaisempi muutosloki**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

categories:
- title: "🚀 Uudet ominaisuudet"
labels:
- "feature"
- "enhancement"
- title: "🐛 Korjaukset"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "📖 Dokumentaatio"
labels:
- "documentation"
- title: "🧰 Ylläpito"
labels:
- "chore"
- "internal"

exclude-labels:
- "skip-changelog"

change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

version-resolver:
major:
labels:
- "major"
- "breaking"
minor:
labels:
- "minor"
- "feature"
- "enhancement"
patch:
labels:
- "patch"
- "fix"
- "bug"
default: patch
13 changes: 13 additions & 0 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Enforce PR labels for release drafter

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
steps:
- uses: yogevbd/enforce-label-action@2.2.2
with:
REQUIRED_LABELS_ANY: "bug,enhancement,internal,documentation,skip-changelog"
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','enhancement','internal','documentation','skip-changelog'] for the PR"
12 changes: 12 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
34 changes: 34 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Drafter

on:
push:
branches:
- main

permissions:
contents: read

jobs:
update_release_draft:
name: "📝 Update Release Draft"
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: read
runs-on: ubuntu-latest
outputs:
name: ${{ steps.release-drafter.outputs.name }}
tag_name: ${{ steps.release-drafter.outputs.tag_name }}
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v6
id: release-drafter
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
echo "name: ${{ steps.release-drafter.outputs.tag_name }}"
echo "tag=${{ steps.release-drafter.outputs.tag_name }}"
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release
on:
push:
tags:
- v*.*.*

jobs:
release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
steps:
- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT

- uses: release-drafter/release-drafter@master
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
runs-on: ubuntu-24.04
needs: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt update && sudo apt install qtbase5-dev qttools5-dev-tools
sudo pip install qgis-plugin-ci --break-system-packages
- name: Release
run: |
qgis-plugin-ci release ${{ needs.release.outputs.version }} \
--release-tag ${{ needs.release.outputs.tag }} \
--disable-submodule-update \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--create-plugin-repo
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
rev: v4.6.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Expand Down
Loading