fixed typo in version number of rascal #654
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 Deploy | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v[0-9]+.*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: buildjet-2vcpu-ubuntu-2204 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
cache-dependency-path: rascal-vscode-extension/package-lock.json | |
registry-url: 'https://registry.npmjs.org' | |
- name: Package & compile rascal-lsp | |
working-directory: ./rascal-lsp | |
run: mvn -B clean verify | |
env: | |
MAVEN_OPTS: "-Xmx6G" | |
- name: Append build id if pre-release | |
working-directory: ./rascal-vscode-extension | |
run: sed -i "s/\\(\"version\":.*\\)\\-head/\\1-head$GITHUB_RUN_NUMBER/" package.json | |
- name: Package & compile extension | |
working-directory: ./rascal-vscode-extension | |
run: | | |
npm ci | |
npm run license-check | |
npm run compile | |
npm run lint | |
npm run compile-tests | |
npm run normalTest | |
# disable vs-code test npm run test | |
- name: package extension | |
working-directory: rascal-vscode-extension | |
run: | | |
npm run lsp4j:package | |
npx vsce package | |
- name: upload final vsix | |
uses: actions/upload-artifact@v3 | |
with: | |
path: rascal-vscode-extension/*.vsix | |
retention-days: 20 | |
- name: Publish release to Open VSX Registry | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: HaaLeo/publish-vscode-extension@v1 | |
id: publishToOpenVSX | |
with: | |
packagePath: ./rascal-vscode-extension | |
pat: ${{ secrets.OPEN_VSX_ACCESS }} | |
registryUrl: https://open-vsx.org | |
- name: Publish release to Visual Studio Marketplace | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
packagePath: ./rascal-vscode-extension | |
pat: ${{ secrets.AZURE_USETHESOURCE_PAT }} | |
registryUrl: https://marketplace.visualstudio.com | |
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} # copy exact same vsix from the previous step | |
- name: Prepare Draft Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
draft: true | |
files: ${{ steps.publishToOpenVSX.outputs.vsixPath }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: rewrite package.json & readme for NPM package | |
working-directory: rascal-vscode-extension | |
run: | | |
node src/rewritePackageForNPMPublish.js | |
rm -rf assets/images/ # remove non open source assets | |
# remove non-used jars | |
rm assets/jars/rascal-core.jar | |
rm assets/jars/typepal.jar | |
mv README-lib.md README.md | |
- name: Test compile for NPM | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
working-directory: rascal-vscode-extension | |
run: npm run compile | |
- name: publish to NPM | |
if: startsWith(github.ref, 'refs/tags/v') | |
working-directory: rascal-vscode-extension | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --access=public |