Skip to content

Commit

Permalink
🧱 Fix versions and release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Jan 17, 2024
1 parent d91c086 commit 4017c86
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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` |
Expand Down
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 19 additions & 8 deletions common/update-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}

Expand Down
2 changes: 1 addition & 1 deletion vsts/vss-extension.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "qodana-dev",
"name": "Qodana (Dev)",
"version": "2023.2.11",
"version": "2023.3.1",
"publisher": "JetBrains",
"targets": [
{
Expand Down

0 comments on commit 4017c86

Please sign in to comment.