Skip to content

Commit 1a29e60

Browse files
committed
Update GHA with draft script
1 parent 66e6ea6 commit 1a29e60

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

.github/workflows/jetbrains-auto-update-template.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,35 @@ jobs:
2020
with:
2121
task: ${{ inputs.productId }}
2222

23+
draft-script:
24+
runs-on: ${{ needs.create-runner.outputs.label }}
25+
container:
26+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:pd-test-new-preview-gha.24525
27+
needs: [ create-runner ]
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Setup Environment
31+
uses: ./.github/actions/setup-environment
32+
with:
33+
identity_provider: ${{ github.ref == 'refs/heads/main' && secrets.CORE_DEV_PROVIDER || secrets.DEV_PREVIEW_PROVIDER }}
34+
service_account: ${{ github.ref == 'refs/heads/main' && secrets.CORE_DEV_SA || secrets.DEV_PREVIEW_SA }}
35+
leeway_segment_key: ${{ secrets.LEEWAY_SEGMENT_KEY }}
36+
- name: Install dependencies
37+
run: |
38+
cd ./components/ide/gha-update-image/
39+
yarn
40+
npm i -g bun
41+
- name: Find Nightly Target
42+
id: target
43+
run: |
44+
cd ./components/ide/gha-update-image/
45+
bun run index-jb-nightly.ts --task=1 --productCode=${{ inputs.productCode }}
46+
47+
if [ -f /tmp/__gh_output.txt ]
48+
then
49+
cat /tmp/__gh_output.txt >> $GITHUB_OUTPUT
50+
fi
51+
2352
update-jetbrains:
2453
runs-on: ${{ needs.create-runner.outputs.label }}
2554
container:
@@ -55,7 +84,7 @@ jobs:
5584
LEEWAY_REMOTE_CACHE_BUCKET: ${{ github.ref == 'refs/heads/main' && 'leeway-cache-main-c514a01' || 'leeway-cache-dev-3ac8ef5' }}
5685
run: |
5786
imageRepoBase=${{ github.ref == 'refs/heads/main' && 'eu.gcr.io/gitpod-core-dev/build' || 'eu.gcr.io/gitpod-dev-artifact/build' }}
58-
leeway build -Dversion=latest -DimageRepoBase=$imageRepoBase -DbuildNumber=${{ steps.ide-version.outputs.ideBuildVersion }} components/ide/jetbrains/image:${{ inputs.productId }}-latest -DjbBackendVersion=${{ steps.ide-version.outputs.ideVersion }}
87+
echo "leeway build -Dversion=latest -DimageRepoBase=$imageRepoBase -DbuildNumber=${{ steps.ide-version.outputs.ideBuildVersion }} components/ide/jetbrains/image:${{ inputs.productId }}-latest -DjbBackendVersion=${{ steps.ide-version.outputs.ideVersion }}"
5988
- name: Get previous job's status
6089
id: lastrun
6190
uses: filiptronicek/get-last-job-status@main

components/ide/gha-update-image/index-jb-nightly.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// ```
1010

1111
import { $ } from "bun";
12-
import { pathToBackendPluginGradleLatest, readWorkspaceYaml } from "./lib/common";
12+
import { appendGitHubOutput, pathToBackendPluginGradleLatest, readWorkspaceYaml } from "./lib/common";
1313
import { maybeCompatible, parseGradleProperties, parseGradlePropertiesFromTaskConfig } from "./lib/jb-helper/jb-helper";
1414
import { fetchProductReleases, ReleaseItem, releaseItemStr } from "./lib/jb-helper/jb-releases";
1515
import { getTaskFromArgs } from "./lib/jb-helper/jb-gradle-task-config";
@@ -70,3 +70,7 @@ const targetConfig = parseGradlePropertiesFromTaskConfig(task, targetRelease);
7070
console.log(
7171
`Going to exec \`leeway build -Dversion=latest -DimageRepoBase=$imageRepoBase -DbuildNumber=${targetConfig.platformVersion} components/ide/jetbrains/image:${task.productId}-latest -DjbBackendVersion=${targetRelease.version}\``,
7272
);
73+
74+
appendGitHubOutput(`buildNumber=${targetConfig.platformVersion}`);
75+
appendGitHubOutput(`image=${task.productId}`);
76+
appendGitHubOutput(`jbBackendVersion=${targetRelease.version}`);

0 commit comments

Comments
 (0)