Skip to content

Commit c5219ff

Browse files
committed
github-required version
1 parent cb5473e commit c5219ff

File tree

2,162 files changed

+656692
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,162 files changed

+656692
-0
lines changed

.github/workflows/extensions.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
push:
3+
branches: [main]
4+
workflow_dispatch:
5+
jobs:
6+
extensions:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
token: ${{ secrets.RELEASE_TOKEN }}
13+
- name: Configure git user
14+
run: |
15+
git config --local user.email "action@github.com"
16+
git config --local user.name "GitHub Action"
17+
- name: Download flowR release
18+
uses: robinraju/release-downloader@v1
19+
with:
20+
repository: flowr-analysis/vscode-flowr
21+
latest: true
22+
fileName: "*.vsix"
23+
- name: Cleanup previous flowR release
24+
run: |
25+
rm -rf .vscode/extensions/vscode-flowr
26+
mkdir -p .vscode/extensions/vscode-flowr
27+
- name: Unpack flowR release
28+
run: |
29+
unzip -o *.vsix -d _unpacked
30+
cp -a _unpacked/extension/. .vscode/extensions/vscode-flowr
31+
rm -r _unpacked *.vsix
32+
- name: Commit and push changes
33+
run: |
34+
git add .
35+
git commit -m "[skip ci] Update flowR extension"
36+
git push
37+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
3+
find_npm_linux() {
4+
export NPM_CMD="npm"
5+
export NPX_CMD="npx"
6+
7+
if ! (type $NPM_CMD >> /dev/null); then
8+
echo "npm not found, trying to make it available using nvm..."
9+
if type nvm >> /dev/null; then
10+
echo "nvm found, using it to install the latest lts node"
11+
nvm use --lts
12+
else
13+
echo "nvm not found, trying to make it available using the nvm.sh"
14+
# try to make it available based on https://github.com/typicode/husky/issues/912#issuecomment-817522060
15+
export NVM_DIR="$HOME/.nvm/nvm.sh"
16+
. "$(dirname $NVM_DIR)/nvm.sh"
17+
18+
export NVM_DIR="$HOME/.nvm"
19+
a=$(nvm ls --no-colors | grep 'node')
20+
v=$(echo "$a" | sed -E 's/.*\(-> ([^ ]+).*/\1/')
21+
22+
export PATH="$NVM_DIR/versions/node/$v/bin:$PATH"
23+
24+
if ! (type $NPM_CMD >> /dev/null); then
25+
echo "no variant of npm or nvm found, trying to use the npm.cmd"
26+
export NPM_CMD="npm.cmd"
27+
export NPX_CMD="npx.cmd"
28+
fi
29+
fi
30+
fi
31+
}
32+
33+
if [ -z "${OSTYPE+x}" ]; then
34+
find_npm_linux
35+
else
36+
case "$OSTYPE" in
37+
msys*) export NPM_CMD="npm.cmd" ;
38+
export NPX_CMD="npx.cmd" ;;
39+
*) find_npm_linux ;;
40+
esac
41+
fi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; }
3+
git lfs pre-push "$@"
4+
5+
. .githooks/load-npm.sh
6+
$NPM_CMD run lint
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: lint
2+
on:
3+
push:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches: [main]
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
- name: Install node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 23.8.x
17+
registry-url: 'https://registry.npmjs.org/'
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Lint
21+
run: npm run lint
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: package
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
package:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
- name: Install node
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: 23.8.x
15+
registry-url: 'https://registry.npmjs.org/'
16+
- name: Install vsce
17+
run: npm install -g @vscode/vsce
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Package
21+
run: vsce package
22+
- name: Upload artifact
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: Extension vsix
26+
path: vscode-flowr-*.vsix
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: release
2+
on:
3+
push:
4+
branches: [main]
5+
jobs:
6+
test:
7+
name: Test for release
8+
if: startsWith(github.event.head_commit.message, '[release:minor]') ||
9+
startsWith(github.event.head_commit.message, '[release:major]') ||
10+
startsWith(github.event.head_commit.message, '[release:patch]')
11+
uses: flowr-analysis/vscode-flowr/.github/workflows/test.yml@main
12+
13+
release:
14+
runs-on: ubuntu-latest
15+
needs: [test]
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
token: ${{ secrets.RELEASE_TOKEN }}
21+
fetch-depth: 0
22+
- name: Configure git user
23+
run: |
24+
git config --local user.email "action@github.com"
25+
git config --local user.name "GitHub Action"
26+
27+
- name: Install node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 23.8.x
31+
registry-url: "https://registry.npmjs.org/"
32+
- name: Install vsce
33+
run: npm install -g @vscode/vsce
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Bump version
38+
id: version
39+
run: |
40+
step=$(echo "$MESSAGE" | sed -n -E 's/\[release:(patch|minor|major)].*/\1/p')
41+
if [ -z "$step" ]; then
42+
echo "fatal: Release step not found in commit message."
43+
exit 1
44+
fi
45+
46+
new_version=$(npm version "$step" -m "[skip ci] Release %s")
47+
echo "::set-output name=release_tag::$new_version"
48+
env:
49+
# apparently, putting the message into an env variable first sanitizes it
50+
# (see https://github.com/flowr-analysis/flowr/security/code-scanning/29)
51+
MESSAGE: ${{ github.event.head_commit.message }}
52+
53+
- name: Package
54+
run: vsce package
55+
56+
# but not the tag as it may be created by the release action
57+
- name: Push version update commmit
58+
run: git push
59+
60+
- name: Get changelog
61+
id: changelog
62+
run: |
63+
new_version_tag=${{ steps.version.outputs.release_tag }}
64+
new_version_num=${new_version_tag:1}
65+
changelog=$(awk -v version="$new_version_num" '/# Version / {printit = $3 == version}; printit;' "CHANGELOG.md")
66+
echo "::set-output name=body::$changelog"
67+
- name: GitHub release
68+
uses: softprops/action-gh-release@v2
69+
with:
70+
files: vscode-flowr-*.vsix
71+
token: ${{ secrets.RELEASE_TOKEN }}
72+
tag_name: ${{ steps.version.outputs.release_tag }}
73+
body: ${{ steps.changelog.outputs.body }}
74+
75+
- name: Marketplace
76+
run: vsce publish
77+
env:
78+
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: test
2+
on:
3+
push:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches: [main]
7+
workflow_call:
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
- name: Install node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 23.8.x
18+
registry-url: 'https://registry.npmjs.org/'
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Test
22+
# VSCode tests require the app's window to be opened, so we use xvfb to give the runner a display
23+
# (https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions)
24+
uses: coactions/setup-xvfb@v1
25+
with:
26+
run: npm run test

0 commit comments

Comments
 (0)