Add files to web build script #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
cache: 'npm' | |
cache-dependency-path: ./dsl/dlang/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
working-directory: ./dsl/dlang | |
- name: Generate langium AST | |
run: npm run langium:generate | |
working-directory: ./dsl/dlang | |
- name: Build project | |
run: npm run build | |
working-directory: ./dsl/dlang | |
- name: Run tests | |
run: npm test | |
working-directory: ./dsl/dlang | |
- name: Get version | |
id: get_version | |
run: echo "VERSION=$(node -p "require('./dsl/dlang/package.json').version")" >> $GITHUB_ENV | |
- name: Add build tag to git | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git tag "${{env.VERSION}}.${{ github.run_number }}" | |
git push --tags | |
- name: Install vsce | |
run: npm install -g @vscode/vsce | |
- name: Build vsix | |
run: npm run vscode:prepublish && vsce package | |
working-directory: ./dsl/dlang | |
shell: bash | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: ./dsl/dlang/domain-lang-${{env.VERSION}}.vsix | |