-
Notifications
You must be signed in to change notification settings - Fork 1.2k
158 lines (144 loc) · 8.18 KB
/
jetbrains-update-plugin-platform-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
on:
workflow_call:
inputs:
pluginName:
description: Name of the plugin.
type: string
required: true
pluginId:
description: ID of the plugin in lowercase and without spaces.
type: string
required: true
taskId:
description: ID of task to exec
type: string
required: true
isBackendPlugin:
description: Action is execing for Gitpod JetBrains Backend Plugin or not
type: boolean
required: true
secrets:
slackWebhook:
required: true
roboquatRepoPat:
required: true
jobs:
update-plugin-platform:
name: Update Platform Version from ${{ inputs.pluginName }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
curl -fsSL https://github.com/csweichel/oci-tool/releases/download/v0.2.1/oci-tool_0.2.1_linux_amd64.tar.gz | tar xz -C /usr/local/bin
chmod +x /usr/local/bin/oci-tool
cd ./components/ide/gha-update-image/
yarn
npm i -g bun
- name: Check for Update
id: change
run: |
cd ./components/ide/gha-update-image/
bun run index-jb-platform-update.ts --task=${{ inputs.taskId }}
if [ -f /tmp/__gh_output.txt ]
then
cat /tmp/__gh_output.txt >> $GITHUB_OUTPUT
fi
- name: Detect file changes
id: changes
run: |
if [ $(git status --porcelain | wc -l) -gt 0 ]; then
echo "dirty=true" >> $GITHUB_OUTPUT
else
echo "dirty=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request for Gateway Plugin
id: create-gateway-pr
if: ${{ steps.changes.outputs.dirty && !inputs.isBackendPlugin }}
uses: peter-evans/create-pull-request@v6
with:
title: "[JetBrains] Update Platform Version from ${{ inputs.pluginName }}"
body: |
## Description
This PR updates the Platform Version from ${{ inputs.pluginName }} to the latest version.
## How to test
Merge if tests are green, if something breaks then add tests for regressions.
<details>
<summary>if you want to test manually for some reasons</summary>
1. Ensure you have the Gateway installed from [JetBrains Toolbox App](https://www.jetbrains.com/toolbox-app/) and have it up-to-date.
- You should use Gateway version corresponding to plugin qualifier, i.e. for stable plugin test with released, for latest test with EAP.
- It could be that a new Gateway is not published for the given SDK yet then wait for it to be published. You can check the build version in the About dialog.
2. Download the plugin build related to this branch in [Dev Versions](https://plugins.jetbrains.com/plugin/18438-gitpod-gateway/versions/dev), and [install it on the Gateway](https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk).
- You can also uninstall current Gitpod plugin, configure dev channel using https://plugins.jetbrains.com/plugins/list?channel=dev&pluginId=18438-gitpod-gateway and restart GW to test that the proper version is detected and installed.
3. Create a new workspace from the Gateway (it's ok to use the pre-selected IDE and Repository) and confirm if JetBrains Client can connect to it.
</details>
## Release Notes
```release-note
NONE
```
## Werft options:
- [x] /werft publish-to-jb-marketplace
- [x] /werft with-preview
- [x] /werft with-large-vm
- [x] /werft with-gce-vm
- [x] with-integration-tests=jetbrains
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
_This PR was created automatically with GitHub Actions using [this](https://github.com/gitpod-io/gitpod/blob/main/.github/workflows/jetbrains-update-plugin-platform-template.yml) template._
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"
branch: "jetbrains/${{ inputs.pluginId }}-platform"
labels: "team: IDE,editor: jetbrains"
team-reviewers: |
team-experience
token: ${{ secrets.roboquatRepoPat }}
committer: Robo Quat <[email protected]>
author: Robo Quat <[email protected]>
- name: Create Pull Request for Backend Plugin
id: create-backend-pr
if: ${{ steps.changes.outputs.dirty && inputs.isBackendPlugin }}
uses: peter-evans/create-pull-request@v6
with:
title: "[JetBrains] Update Platform Version from ${{ inputs.pluginName }}"
body: |
## Description
This PR updates the Platform Version from ${{ inputs.pluginName }} to the latest version.
## How to test
Merge if tests are green, if something breaks then add tests for regressions.
<details>
<summary>if you want to test manually for some reasons</summary>
1. Open the preview environment generated for this branch
2. Choose the _Latest Release (Unstable)_ version of IntelliJ IDEA as your preferred editor
3. Start a workspace using this repository: https://github.com/gitpod-samples/spring-petclinic
4. Verify that the workspace starts successfully
5. Verify that the IDE opens successfully
</details>
## Release Notes
```release-note
NONE
```
## Werft options:
- [x] /werft with-preview
- [x] /werft with-large-vm
- [x] /werft with-gce-vm
- [x] with-integration-tests=jetbrains
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
_This PR was created automatically with GitHub Actions using [this](https://github.com/gitpod-io/gitpod/blob/main/.github/workflows/jetbrains-update-plugin-platform-template.yml) template._
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"
branch: "jetbrains/${{ inputs.pluginId }}-platform"
labels: "team: IDE,editor: jetbrains"
team-reviewers: |
team-experience
token: ${{ secrets.roboquatRepoPat }}
committer: Robo Quat <[email protected]>
author: Robo Quat <[email protected]>
- name: Get previous job's status
id: lastrun
uses: filiptronicek/get-last-job-status@main
- name: Slack Notification
if: ${{ (success() && steps.lastrun.outputs.status == 'failed') || failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.slackWebhook }}
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ${{ inputs.productName }}
SLACK_FOOTER: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow logs>"