Skip to content

Commit a75eea3

Browse files
committed
Add gh actions pipelines
1 parent 6bc9833 commit a75eea3

3 files changed

Lines changed: 188 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions: {}
8+
9+
jobs:
10+
build-and-test:
11+
name: Lint, Build, Test
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
defaults:
17+
run:
18+
working-directory: extension
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
23+
with:
24+
persist-credentials: false
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # 6.4.0
28+
with:
29+
node-version: 22
30+
cache: npm
31+
cache-dependency-path: extension/package-lock.json
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Lint
37+
run: npm run lint
38+
39+
- name: Build
40+
run: npm run build
41+
42+
- name: Test
43+
run: xvfb-run -a npm run test
44+
45+
- name: Package VSIX
46+
run: npx @vscode/vsce package --out turtle-pr-${{ github.run_number }}.vsix
47+
48+
- name: Upload packaged VSIX artifact
49+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0
50+
with:
51+
name: turtle-vsix
52+
path: extension/turtle-pr-${{ github.run_number }}.vsix
53+
if-no-files-found: error
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Publish VS Code Extension
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: 'Release version (semantic versioning, e.g. 1.2.3)'
8+
required: true
9+
type: string
10+
11+
permissions: {}
12+
13+
env:
14+
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
15+
16+
jobs:
17+
publish:
18+
name: Package and Publish to Marketplace
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
actions: read
23+
issues: write
24+
pull-requests: write
25+
26+
defaults:
27+
run:
28+
working-directory: extension
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
33+
with:
34+
persist-credentials: true
35+
36+
- name: Validate version input
37+
run: |
38+
if [[ ! "${RELEASE_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
39+
echo "Error: '${RELEASE_VERSION}' is not a valid semantic version (expected format: X.Y.Z)"
40+
exit 1
41+
fi
42+
echo "Version '${RELEASE_VERSION}' is valid."
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # 6.4.0
46+
with:
47+
node-version: 22
48+
package-manager-cache: false
49+
50+
- name: Set version in package.json
51+
run: |
52+
npm version --no-git-tag-version -- "${RELEASE_VERSION}"
53+
54+
- name: Install dependencies
55+
run: npm ci
56+
57+
- name: Lint
58+
run: npm run lint
59+
60+
- name: Build
61+
run: npm run build
62+
63+
- name: Test
64+
run: xvfb-run -a npm run test
65+
66+
- name: Package VSIX
67+
run: |
68+
npx @vscode/vsce package --out "turtle-${RELEASE_VERSION}.vsix"
69+
70+
- name: Upload VSIX artifact
71+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0
72+
with:
73+
name: turtle-vsix
74+
path: extension/turtle-${{ env.RELEASE_VERSION }}.vsix
75+
if-no-files-found: error
76+
77+
- name: Publish to VS Code Marketplace
78+
run: npx @vscode/vsce publish --pat "${{ secrets.VS_MARKETPLACE_TOKEN }}"
79+
80+
- name: Commit version changes and push to upstream repository
81+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
82+
with:
83+
branch: ${{ env.release_branch_name }}
84+
commit_user_name: github-actions
85+
commit_user_email: github-actions@github.com
86+
commit_author: Author <actions@github.com>
87+
file_pattern: 'package.json, package-lock.json'
88+
89+
- name: Create Github release (full)
90+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
91+
with:
92+
body: "Release version ${{ env.RELEASE_VERSION }}."
93+
tag_name: v${{ env.RELEASE_VERSION }}
94+
target_commitish: ${{ env.release_branch_name }}
95+
draft: false
96+
prerelease: false
97+
files: |
98+
turtle-${{ env.RELEASE_VERSION }}.vsix
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/zizmor.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright (c) 2026 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
3+
#
4+
name: GitHub Actions SAST (zizmor)
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
13+
14+
permissions: {}
15+
16+
jobs:
17+
zizmor:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
25+
with:
26+
persist-credentials: false
27+
28+
- name: Run zizmor (PR annotations)
29+
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
30+
with:
31+
advanced-security: false
32+
version: v1.22.0
33+
annotations: true
34+
persona: auditor
35+
min-severity: medium

0 commit comments

Comments
 (0)