Skip to content

Commit

Permalink
Update project configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Nov 9, 2022
1 parent 3e7945b commit 15aad8d
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 142 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,27 @@ jobs:
changelog: ${{ steps.properties.outputs.changelog }}
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.4

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
cache: gradle

# Set environment variables
- name: Export Properties
Expand All @@ -71,19 +77,26 @@ jobs:
# Run tests
- name: Run Tests
run: ./gradlew test
run: ./gradlew check

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

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

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
Expand All @@ -95,21 +108,14 @@ jobs:
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/qodana-action@v2.1-eap

# Collect Qodana Result
- name: Collect Qodana Result
uses: actions/upload-artifact@v2
with:
name: qodana-result
path: ${{ github.workspace }}/qodana
uses: JetBrains/qodana-action@v2022.2.2

# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
Expand All @@ -120,11 +126,11 @@ jobs:
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "::set-output name=filename::$FILENAME"
echo "::set-output name=filename::${FILENAME:0:-4}"
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
Expand All @@ -136,11 +142,13 @@ jobs:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3

# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ jobs:
release:
name: Publish Plugin
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name }}

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
cache: gradle

# Set environment variables
- name: Export Properties
Expand Down Expand Up @@ -70,6 +72,9 @@ jobs:
- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: ./gradlew publishPlugin

# Upload artifact as a release asset
Expand All @@ -86,6 +91,7 @@ jobs:
run: |
VERSION="${{ github.event.release.tag_name }}"
BRANCH="changelog-update-$VERSION"
LABEL="release changelog"
git config user.email "action@github.com"
git config user.name "GitHub Action"
Expand All @@ -94,8 +100,12 @@ jobs:
git commit -am "Changelog update - $VERSION"
git push --set-upstream origin $BRANCH
gh label create "$LABEL" \
--description "Pull requests with release changelog update" \
|| true
gh pr create \
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--base main \
--label "$LABEL" \
--head $BRANCH
Loading

0 comments on commit 15aad8d

Please sign in to comment.