Skip to content

Commit

Permalink
Create version 2
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Aug 9, 2024
1 parent 4cc6516 commit 31cf546
Show file tree
Hide file tree
Showing 51 changed files with 1,302 additions and 501 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
insert_final_newline = true
max_line_length = 120

[{*.kt,*.kts}]
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_imports_layout=java.**,javax.**,|,*,|,com.intellij.**,com.jetbrains.**,|,com.jetbrains.python.**,|,com.github.pyvenvmanage.**,|^
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bug report
description: Create a report to help us improve
labels: ["bug"]
body:
- type: input
id: gradle
attributes:
label: Used within IDE (name and version)
placeholder: PyCharm 2024.2
validations:
required: true

- type: dropdown
id: os
attributes:
label: Operating System
options:
- macOS
- Linux
- Windows

- type: input
id: version
attributes:
label: PyVenv Plugin version
placeholder: 2.0.0
validations:
required: true

- type: textarea
id: issue
attributes:
label: What happened?
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: logs
attributes:
label: Relevant log output or stack trace
description: If there is an exception stack trace post it here.
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://github.com/tox-dev/PyVenvManage?tab=readme-ov-file#pyvenvmanage
about: Check the README file in the first place.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Feature request
description: Suggest an idea for this project
labels: ["enhancement"]
body:
- type: textarea
id: cause
attributes:
label: Describe the need of your request
description: A clear and concise description of what the need or problem is.
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed solution
description: A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives you've considered
description: What did you try so far to accomplish the goal?

- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Dependabot configuration:
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for Gradle dependencies
- package-ecosystem: "gradle"
directory: "/"
target-branch: "next"
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "next"
schedule:
interval: "daily"
227 changes: 227 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
name: Build
on:
push:
branches: [main]
pull_request:

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

jobs:
build:
name: Build plugin
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build plugin
run: ./gradlew buildPlugin
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload artifact for later download
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
info:
name: Get plugin info
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Export plugin properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
verify:
name: Verify plugin
needs: [build, info]
runs-on: ubuntu-latest
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
- name: Checkout git repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Set up Gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Cache Plugin Verifier IDEs
- name: Set up Plugin Verifier IDEs Cache
uses: actions/cache@v4
with:
path: ${{ needs.info.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.info.outputs.pluginVerifierHomeDir }}

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier

# Run tests and upload a code coverage report
test:
name: Test
needs: [build]
runs-on: ubuntu-latest
steps:
# Check out the current repository
- name: Checkout git repository
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Set up Gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Run tests
- name: Run Tests
run: ./gradlew check

# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml

# Run Qodana inspections and provide report
inspectCode:
name: Inspect code
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Checkout git repository
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/[email protected]
with:
cache-default-branch-only: true

# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
releaseDraft:
name: Release draft
if: github.event_name != 'pull_request'
needs: [build, info, test, inspectCode, verify]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Check out the current repository
- name: Checkout git repository
uses: actions/checkout@v4

# Remove old release drafts by using the curl request for the available releases with a draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
# Create a new release draft which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ needs.info.outputs.version }}" \
--draft \
--title "v${{ needs.info.outputs.version }}" \
--notes "$(cat << 'EOM'
${{ needs.info.outputs.changelog }}
EOM
)"
35 changes: 0 additions & 35 deletions .github/workflows/check.yaml

This file was deleted.

Loading

0 comments on commit 31cf546

Please sign in to comment.