Skip to content

Commit 9b891c1

Browse files
totadavid95maximtop
authored andcommitted
Pull request 61: AG-47879 Enhance release workflow with pre-release support
Squashed commit of the following: commit 2dcbbf6 Author: scripthunter7 <d.tota@adguard.com> Date: Mon Nov 17 17:49:37 2025 +0100 revert file names commit b1991b9 Author: scripthunter7 <d.tota@adguard.com> Date: Mon Nov 17 17:47:49 2025 +0100 revert some changes to avoid conflicts commit 30048b8 Author: scripthunter7 <d.tota@adguard.com> Date: Mon Nov 3 18:02:19 2025 +0100 update bamboo specs list commit 6fd0261 Author: scripthunter7 <d.tota@adguard.com> Date: Mon Nov 3 18:01:43 2025 +0100 revert permissions commit d229e08 Author: scripthunter7 <d.tota@adguard.com> Date: Mon Nov 3 18:00:04 2025 +0100 separate release process commit b63104c Author: scripthunter7 <d.tota@adguard.com> Date: Thu Oct 30 15:13:20 2025 +0100 fix empty variables block commit 3424b5e Author: scripthunter7 <d.tota@adguard.com> Date: Thu Oct 30 15:11:45 2025 +0100 add conditional handling of publish args for VS Code extensions - Added checks for optional additionalPublishArgs in both VS Code and OpenVSX marketplace deployments - Removed unused additionalPublishArgs variable declarations from marketplace configurations - Modified publish commands to only include additional args when explicitly set - Ensures backward compatibility while allowing flexible publishing options commit 1048326 Author: scripthunter7 <d.tota@adguard.com> Date: Thu Oct 30 14:26:42 2025 +0100 test null value commit 8064b4f Author: scripthunter7 <d.tota@adguard.com> Date: Thu Oct 30 14:21:39 2025 +0100 update var commit 6992486 Author: scripthunter7 <d.tota@adguard.com> Date: Thu Oct 30 14:13:29 2025 +0100 Enhance release workflow with pre-release support
1 parent 58fdb7b commit 9b891c1

4 files changed

Lines changed: 289 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,47 @@ jobs:
5858
5959
pnpm extract-changelog -e $VERSION
6060
61+
- name: Set up variables
62+
uses: actions/github-script@v7
63+
with:
64+
script: |
65+
const tag = context.ref.replace('refs/tags/', '');
66+
67+
const refRes = await github.rest.git.getRef({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
ref: `tags/${tag}`,
71+
});
72+
73+
const { object } = refRes.data;
74+
75+
let tagMessage = '';
76+
if (object.type === 'tag') {
77+
// Annotated tag
78+
const tagObj = await github.rest.git.getTag({
79+
owner: context.repo.owner,
80+
repo: context.repo.repo,
81+
tag_sha: object.sha,
82+
});
83+
tagMessage = (tagObj.data.message || '').trim();
84+
} else {
85+
// Lightweight tag
86+
tagMessage = '';
87+
}
88+
89+
const isPreRelease = tagMessage.toLowerCase() === 'prerelease';
90+
91+
core.exportVariable('TAG_NAME', tag);
92+
core.exportVariable('IS_PRERELEASE', isPreRelease.toString());
93+
6194
- name: Create GitHub Release
6295
uses: softprops/action-gh-release@v2
6396
with:
6497
files: |
6598
syntaxes/out/adblock.plist
6699
out/vscode-adblock.vsix
67100
draft: false
68-
prerelease: false
101+
prerelease: ${{ env.IS_PRERELEASE }}
69102
body_path: ./out/TEMP_CHANGES.md
70103
env:
71104
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

bamboo-specs/bamboo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
---
66
!include 'build.yaml'
77
---
8+
!include 'build-prerelease.yaml'
9+
---
810
!include 'deploy.yaml'
911
---
12+
!include 'deploy-prerelease.yaml'
13+
---
1014
!include 'permissions.yaml'

bamboo-specs/build-prerelease.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
version: 2
3+
plan:
4+
project-key: AJL
5+
key: VSCODEADBLOCKSYNTAXBUILDPRERELEASE
6+
name: vscode adblock syntax - build prerelease
7+
variables:
8+
dockerNode: adguard/node-ssh:22.14--0
9+
10+
stages:
11+
- Build:
12+
manual: false
13+
final: false
14+
jobs:
15+
- Build
16+
17+
Build:
18+
key: BUILD
19+
other:
20+
clean-working-dir: true
21+
docker:
22+
image: ${bamboo.dockerNode}
23+
volumes:
24+
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
25+
tasks:
26+
- checkout:
27+
force-clean-build: true
28+
- script:
29+
interpreter: SHELL
30+
scripts:
31+
- |-
32+
set -e
33+
set -x
34+
35+
# Fix mixed logs
36+
exec 2>&1
37+
38+
ls -laht
39+
40+
# Set cache directory
41+
pnpm config set store-dir ${bamboo.cachePnpm}
42+
43+
# Install dependencies
44+
pnpm install
45+
46+
# Check TypeScript types
47+
pnpm test:compile
48+
49+
# Run markdownlint
50+
pnpm lint:md
51+
52+
# Run ESLint
53+
pnpm lint:ts
54+
55+
# Run Jest tests
56+
pnpm test
57+
58+
# Create production build
59+
pnpm build:prod
60+
61+
# Create build.txt file with version
62+
pnpm build:txt
63+
- inject-variables:
64+
file: out/build.txt
65+
scope: RESULT
66+
namespace: inject
67+
- any-task:
68+
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging
69+
configuration:
70+
selectedRepository: defaultRepository
71+
tagName: v${bamboo.inject.version}
72+
# annotated tag
73+
description: prerelease
74+
final-tasks:
75+
- script:
76+
interpreter: SHELL
77+
scripts:
78+
- |-
79+
set -x
80+
set -e
81+
82+
# Fix mixed logs
83+
exec 2>&1
84+
85+
ls -la
86+
87+
echo "Size before cleanup:" && du -h | tail -n 1
88+
89+
# Cleanup
90+
pnpm clean
91+
92+
echo "Size after cleanup:" && du -h | tail -n 1
93+
# Store the .vsix file as a build artifact
94+
artifacts:
95+
- name: vscode-adblock.vsix
96+
location: out
97+
pattern: vscode-adblock.vsix
98+
shared: true
99+
required: true
100+
requirements:
101+
- adg-docker: true
102+
103+
triggers: []
104+
105+
branches:
106+
create: manually
107+
delete: never
108+
link-to-jira: true
109+
110+
notifications:
111+
- events:
112+
- plan-status-changed
113+
recipients:
114+
- webhook:
115+
name: Build webhook
116+
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo
117+
labels: []
118+
other:
119+
concurrent-build-plugin: system-default
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
version: 2
3+
deployment:
4+
name: VSCode Adblock Syntax - Deploy Prerelease
5+
source-plan: AJL-VSCODEADBLOCKSYNTAXBUILDPRERELEASE
6+
release-naming: ${bamboo.inject.version}
7+
environments:
8+
- marketplace.visualstudio.com
9+
- open-vsx.org
10+
11+
marketplace.visualstudio.com:
12+
docker:
13+
image: adguard/node-ssh:22.14--0
14+
volumes:
15+
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
16+
triggers: []
17+
tasks:
18+
- checkout:
19+
force-clean-build: 'true'
20+
- artifact-download:
21+
artifacts:
22+
- name: vscode-adblock.vsix
23+
- script:
24+
interpreter: SHELL
25+
scripts:
26+
- |-
27+
set -e
28+
set -x
29+
30+
# Fix mixed logs
31+
exec 2>&1
32+
33+
ls -laht
34+
35+
# Set cache directory
36+
pnpm config set store-dir ${bamboo.cachePnpm}
37+
38+
# Install dependencies
39+
pnpm install
40+
41+
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publish-an-extension
42+
# https://github.com/microsoft/vscode-vsce/issues/421#issuecomment-1038911725
43+
pnpm vsce publish --no-dependencies -p ${bamboo.vsceTokenPassword} --pre-release -i vscode-adblock.vsix
44+
final-tasks:
45+
- script:
46+
interpreter: SHELL
47+
scripts:
48+
- |-
49+
set -x
50+
set -e
51+
52+
# Fix mixed logs
53+
exec 2>&1
54+
55+
ls -la
56+
57+
echo "Size before cleanup:" && du -h | tail -n 1
58+
59+
# cleanup
60+
pnpm clean
61+
62+
echo "Size after cleanup:" && du -h | tail -n 1
63+
requirements:
64+
- adg-docker: 'true'
65+
notifications:
66+
- events:
67+
- deployment-started-and-finished
68+
recipients:
69+
- webhook:
70+
name: Deploy webhook
71+
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo
72+
73+
open-vsx.org:
74+
docker:
75+
image: adguard/node-ssh:22.14--0
76+
volumes:
77+
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
78+
triggers: []
79+
tasks:
80+
- checkout:
81+
force-clean-build: 'true'
82+
- artifact-download:
83+
artifacts:
84+
- name: vscode-adblock.vsix
85+
- script:
86+
interpreter: SHELL
87+
scripts:
88+
- |-
89+
set -e
90+
set -x
91+
92+
# Fix mixed logs
93+
exec 2>&1
94+
95+
ls -laht
96+
97+
# Set cache directory
98+
pnpm config set store-dir ${bamboo.cachePnpm}
99+
100+
# Install dependencies
101+
pnpm install
102+
103+
# https://github.com/eclipse/openvsx/wiki/Publishing-Extensions#5-package-and-upload
104+
pnpm ovsx publish vscode-adblock.vsix -p ${bamboo.openVsxTokenPassword} --pre-release
105+
final-tasks:
106+
- script:
107+
interpreter: SHELL
108+
scripts:
109+
- |-
110+
set -x
111+
set -e
112+
113+
# Fix mixed logs
114+
exec 2>&1
115+
116+
ls -la
117+
118+
echo "Size before cleanup:" && du -h | tail -n 1
119+
120+
# Cleanup
121+
pnpm clean
122+
123+
echo "Size after cleanup:" && du -h | tail -n 1
124+
requirements:
125+
- adg-docker: 'true'
126+
notifications:
127+
- events:
128+
- deployment-started-and-finished
129+
recipients:
130+
- webhook:
131+
name: Deploy webhook
132+
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo

0 commit comments

Comments
 (0)