Skip to content

Commit 4e48f36

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

3 files changed

Lines changed: 175 additions & 0 deletions

File tree

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