diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c472591b..98c38205 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,24 @@ permissions: contents: write jobs: + gradle: + runs-on: ubuntu-latest + steps: + - name: Extract version from tag + id: extract_version + run: | + TAG_NAME=${GITHUB_REF##*/} + PATCH_VERSION=$(echo $TAG_NAME | sed -r 's/[^0-9]*([0-9]*)\.([0-9]*)\.([0-9]*)(-.*)?/\3/') + echo "PATCH_VERSION=${PATCH_VERSION}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + cache: gradle + - name: Run linters and test + run: ./gradlew clean build publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_TOKEN }} github: runs-on: ubuntu-latest steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6e52f8b..b12adbc9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,7 +132,7 @@ Apply Gradle Qodana Plugin with snapshot version in Gradle configuration file an ```groovy plugins { - id "org.jetbrains.qodana" version "2023.2.0-SNAPSHOT" + id "org.jetbrains.qodana" version "2023.3.0-SNAPSHOT" } qodana { @@ -143,7 +143,7 @@ Apply Gradle Qodana Plugin with snapshot version in Gradle configuration file an ```kotlin plugins { - id("org.jetbrains.qodana") version "2023.2.0-SNAPSHOT" + id("org.jetbrains.qodana") version "2023.3.0-SNAPSHOT" } qodana { diff --git a/README.md b/README.md index bc7f604c..73d436da 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.2 + uses: JetBrains/qodana-action@v2023.3 env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} # read the steps about it below ``` @@ -96,7 +96,7 @@ Example configuration: ```yaml - name: Qodana Scan - uses: JetBrains/qodana-action@v2023.2 + uses: JetBrains/qodana-action@v2023.3 with: pr-mode: false args: --apply-fixes @@ -136,7 +136,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.2 + uses: JetBrains/qodana-action@v2023.3 with: args: --cleanup - run: | @@ -272,8 +272,8 @@ with: | `artifact-name` | Specify Qodana results artifact name, used for results uploading. Optional. | `qodana-report` | | `cache-dir` | Directory to store Qodana cache. Optional. | `${{ runner.temp }}/qodana/caches` | | `use-caches` | Utilize [GitHub caches](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) for Qodana runs. Optional. | `true` | -| `primary-cache-key` | Set [the primary cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.2-${{ github.ref }}-${{ github.sha }}` | -| `additional-cache-key` | Set [the additional cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.2-${{ github.ref }}` | +| `primary-cache-key` | Set [the primary cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.3-${{ github.ref }}-${{ github.sha }}` | +| `additional-cache-key` | Set [the additional cache key](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key). Optional. | `qodana-2023.3-${{ github.ref }}` | | `cache-default-branch-only` | Upload cache for the default branch only. Optional. | `false` | | `use-annotations` | Use annotation to mark the results in the GitHub user interface. Optional. | `true` | | `pr-mode` | Analyze ONLY changed files in a pull request. Optional. | `true` | diff --git a/action.yaml b/action.yaml index 233e3aff..dcd0e3b2 100644 --- a/action.yaml +++ b/action.yaml @@ -24,11 +24,11 @@ inputs: primary-cache-key: description: 'Set the primary cache key' required: false - default: "qodana-2023.2-${{ github.ref }}-${{ github.sha }}" + default: "qodana-2023.3-${{ github.ref }}-${{ github.sha }}" additional-cache-key: description: 'Set the additional cache key' required: false - default: "qodana-2023.2-${{ github.ref }}" + default: "qodana-2023.3-${{ github.ref }}" cache-default-branch-only: description: 'Upload cache for the default branch only' required: false diff --git a/common/update-cli.js b/common/update-cli.js index 769c451c..448d079b 100644 --- a/common/update-cli.js +++ b/common/update-cli.js @@ -115,26 +115,37 @@ function updateCircleCIChecksums(circleCIConfigPath) { function updateVersions(latestVersion, currentVersion) { latestVersion = latestVersion.slice(1); - const versions = latestVersion.split("."); - const major = parseInt(versions[0]); - const minor = parseInt(versions[1]); - const patch = parseInt(versions[2]); + + const latestVersions = latestVersion.split("."); + const latestMajor = parseInt(latestVersions[0]); + const latestMinor = parseInt(latestVersions[1]); + const latestPatch = parseInt(latestVersions[2]); + let taskJson = JSON.parse( fs.readFileSync( path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), "utf8" ) ); - taskJson.version.Major = major; - taskJson.version.Minor = minor; - taskJson.version.Patch = patch; + taskJson.version.Major = latestMajor; + taskJson.version.Minor = latestMinor; + taskJson.version.Patch = latestPatch; fs.writeFileSync( path.join(__dirname, "..", "vsts", "QodanaScan", "task.json"), JSON.stringify(taskJson, null, 2) ); + const currentVersions = currentVersion.split("."); + const currentMajor = parseInt(currentVersions[0]); + const currentMinor = parseInt(currentVersions[1]); + + replaceStringsInProject(`${latestMajor}.${latestMinor}.${latestPatch}`, `${currentMajor}.${currentMinor}.${latestPatch}`); + replaceStringsInProject(`${latestMajor}.${latestMinor}`, `${currentMajor}.${currentMinor}`); +} + +function replaceStringsInProject(newString, oldString) { process.env.LC_ALL = "C"; const isMacOS = process.platform === "darwin"; - const command = `cd .. && find . -type f -not -name "*.js" -exec sed -i${isMacOS ? " ''" : ""} 's/${currentVersion}/${latestVersion}/g' {} +`; + const command = `cd .. && find . -type f -not -name "*.js" -exec sed -i${isMacOS ? " ''" : ""} 's/${oldString}/${newString}/g' {} +`; execSync(command, { shell: "/bin/bash" }); } diff --git a/vsts/vss-extension.dev.json b/vsts/vss-extension.dev.json index af62997e..fd65be59 100644 --- a/vsts/vss-extension.dev.json +++ b/vsts/vss-extension.dev.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "qodana-dev", "name": "Qodana (Dev)", - "version": "2023.2.11", + "version": "2023.3.1", "publisher": "JetBrains", "targets": [ {