Repository navigation
142 lines (125 loc) · 5.41 KB
/
Copy pathcode-updates.yml
File metadata and controls
142 lines (125 loc) · 5.41 KB
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
name: VS Code Browser updates
on:
workflow_dispatch:
workflow_call:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # pin@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 ./dev/npm-tools && npm ci
echo "$PWD/node_modules/.bin" >> $GITHUB_PATH
cd $GITHUB_WORKSPACE/components/ide/gha-update-image/
yarn
- name: Check for updates
id: updates
run: |
cd ./components/ide/gha-update-image/
bun run index-code.ts
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 Release Pull Request
if: ${{steps.changes.outputs.dirty && steps.updates.outputs.codeVersion}}
id: code-update-pr
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # pin@v6
with:
title: "[VS Code Browser] Update stable code to `${{steps.updates.outputs.codeVersion}}`"
body: |
## Description
Update code to `${{steps.updates.outputs.codeVersion}}`
## How to test
Should be tested already in build PR, double check:
- [ ] New version is pinnable
- [ ] Stable version is updated and it can start workspace with it
### Preview status
gitpod:summary
## Werft options:
- [x] /werft with-preview
- [x] /werft analytics=segment
commit-message: "[VS Code Browser] Update stable code to `${{steps.updates.outputs.codeVersion}}`"
branch: "ide/code-release"
labels: "team: IDE,editor: code (browser)"
token: ${{ secrets.ROBOQUAT_REPO_PAT }}
committer: Robo Quat <roboquat@gitpod.io>
author: Robo Quat <roboquat@gitpod.io>
team-reviewers: |
team-experience
- name: Create Images Update Pull Request
if: ${{steps.changes.outputs.dirty && !steps.updates.outputs.codeVersion}}
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # pin@v6
with:
title: "[code] update code image layers"
body: |
## Description
This PR updates the VS Code Browser image layers to the most recent installer version.
## How to test
Test if changes are working.
i.e.
- `code-helper` it can start browser code with extensions installed
- `gitpod-web-extension` extension functionalities are working well
- `code` is not expected it to be changed
### Preview status
gitpod:summary
## Werft options:
- [x] /werft with-preview
- [x] /werft analytics=segment
commit-message: "[code] update code image layers"
branch: "ide/code-images"
labels: "team: IDE,editor: code (browser)"
token: ${{ secrets.ROBOQUAT_REPO_PAT }}
committer: Robo Quat <roboquat@gitpod.io>
author: Robo Quat <roboquat@gitpod.io>
team-reviewers: |
team-experience
- name: Slack notification (code)
if: ${{ steps.code-update-pr.outputs.pull-request-url }}
uses: rtCamp/action-slack-notify@cdf0a2130cbcdfd82ba5fcac8e076370bf381b36 # pin@v2
env:
SLACK_WEBHOOK: ${{ secrets.IDE_SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: "VS Code Browser release `${{ steps.updates.outputs.codeVersion }}`"
SLACK_MESSAGE: "Release [PR#${{steps.code-update-pr.outputs.pull-request-number}}](${{ steps.code-update-pr.outputs.pull-request-url }}) is created @ask-vscode-engineers"
SLACK_FOOTER: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow logs>"
release-openvscode-server:
runs-on: ubuntu-latest
needs: [update]
if: ${{ needs.update.steps.code-update-pr.outputs.pull-request-url && always() }}
steps:
- uses: gitpod-io/gh-app-auth@v0.1
id: auth
name: Auth GH App
with:
private-key: ${{ secrets.ACTIONS_APP_PKEY }}
app-id: 308947
installation-id: 35574470
- name: Trigger Open VS Code Server Release
uses: actions/github-script@00f12e3e20659f42342b1c0226afda7f7c042325 # pin@v6
with:
github-token: ${{ steps.auth.outputs.token }}
script: |
const releaseBranch = "release/" + "${{ needs.update.steps.updates.outputs.codeVersion }}".split(".").slice(0, 2).join(".")
const result = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'openvscode-releases',
workflow_id: 'release.yml',
ref: 'main',
inputs: {
"quality": "stable",
"commit": releaseBranch,
"uploadRelease": true,
}
})