Change export of ThemeColor to const for inlining #274
Workflow file for this run
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 Publish" | |
on: | |
push: | |
tags: | |
- v0.[0-9]+.[0-9]+ | |
- v0.[0-9]+.[0-9]+-rc[0-9]+ | |
- v0.[0-9]+.[0-9]+-beta[0-9]+ | |
- v0.[0-9]+.[0-9]+-alpha[0-9]+ | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
build: | |
name: Build and Publish | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'sudu-editor' | |
- | |
name: Checkout TeaVM | |
uses: actions/checkout@v3 | |
with: | |
repository: 'kirillp/teavm' | |
ref: 'master' | |
path: 'teavm' | |
- | |
name: Checkout Antlr4 TeaVM compatible repo | |
uses: actions/checkout@v3 | |
with: | |
repository: 'pertsevpv/antlr4-teavm-compatible' | |
ref: 'master' | |
path: 'antlr4' | |
- | |
name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- | |
name: Restore Maven and Gradle Cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/.m2/repository | |
key: sudu-editor-cache | |
- | |
name: Install OBSUtil | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
run: | | |
curl -O https://obs-community-intl.obs.ap-southeast-1.myhuaweicloud.com/obsutil/current/obsutil_linux_amd64.tar.gz | |
tar -z -x -v --strip-components 1 --wildcards -f obsutil_linux_amd64.tar.gz obsutil*/obsutil | |
chmod +x ./obsutil | |
./obsutil config -e=${{ vars.OBS_ENDPOINT }} -i=${{ secrets.HW_ACCESS_KEY }} -k=${{ secrets.HW_SECRET_KEY }} | |
- | |
name: Maven TeaVM | |
run: | | |
cd $GITHUB_WORKSPACE/teavm | |
./gradlew publishToMavenLocal --no-daemon -x test | |
- | |
name: Maven Antlr4 | |
run: | | |
cd $GITHUB_WORKSPACE/antlr4 | |
mvn install -DskipTests | |
- | |
name: Maven Sudu Editor Release | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
run: | | |
cd $GITHUB_WORKSPACE/sudu-editor | |
mvn package -am -pl :codicon -pl :fonts -P downloadFont | |
mvn package -am -pl demo-edit-js,demo-edit-es-module -P release | |
- | |
name: Upload Sudu Editor to OBS | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
uses: nick-fields/retry@v3 | |
id: retry | |
with: | |
max_attempts: 10 | |
timeout_minutes: 5 | |
retry_on: error | |
command: | | |
./obsutil rm -r -f obs://${{ vars.WEBAPP_OBS_NAME }} | |
./obsutil cp -r -f --flat $GITHUB_WORKSPACE/sudu-editor/demo-edit-js/target/demo-edit-js-1.0-SNAPSHOT/ obs://${{ vars.WEBAPP_OBS_NAME }}/ | |
- | |
name: Upload release artifacts to OBS | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
run: | | |
NEW_VERSION=$(echo ${{ github.ref_name }} | tr -d 'v') | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/editor.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/dev/ | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/worker.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/dev/ | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/loader.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/dev/ | |
- | |
name: Maven Sudu Editor | |
run: | | |
cd $GITHUB_WORKSPACE/sudu-editor | |
mvn package -am -pl demo-edit-es-module -P release | |
- | |
name: Upload artifacts to OBS | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
run: | | |
NEW_VERSION=$(echo ${{ github.ref_name }} | tr -d 'v') | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/editor.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/min/ | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/worker.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/min/ | |
./obsutil cp $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module/src/loader.js obs://${{ vars.PUBLIC_OBS_NAME }}/sudu-editor/${NEW_VERSION}/min/ | |
- | |
name: Save Maven Cache | |
if: github.event_name == 'workflow_dispatch' | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/.m2/repository | |
key: sudu-editor-cache | |
- | |
name: Setup Node | |
uses: actions/setup-node@v3 | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@sudu-ide' | |
- | |
name: Publish Sudu Editor package to NPM Registry | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
run: | | |
NEW_VERSION=$(echo ${{ github.ref_name }} | tr -d 'v') | |
echo "::notice::version \"${NEW_VERSION}\"" | |
cd $GITHUB_WORKSPACE/sudu-editor/demo-edit-es-module/module | |
npm version ${NEW_VERSION} | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |