enso/.github/workflows/gui.yml
2021-12-27 17:56:35 +01:00

504 lines
18 KiB
YAML

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# DO NOT CHANGE THIS FILE. IT WAS GENERATED FROM 'build/workflow.js'. READ DOCS THERE TO LEARN MORE.
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
name: GUI CI
"on":
push:
branches:
- develop
- unstable
- stable
pull_request: {}
workflow_dispatch: {}
jobs:
info:
name: Build Info
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - macOS-latest
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
version_assertions:
name: Assertions
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - macOS-latest
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Read changelog info
id: changelog
run: |2-
node ./run ci-gen --skip-version-validation
content=`cat CURRENT_RELEASE_CHANGELOG.json`
echo "::set-output name=content::$content"
shell: bash
- name: Assert Version Unstable
run: node ./run assert-version-unstable --skip-version-validation
if: github.ref == 'refs/heads/unstable' || github.base_ref == 'unstable'
- name: Assert Version Stable
run: node ./run assert-version-stable --skip-version-validation
if: github.ref == 'refs/heads/stable' || github.base_ref == 'stable'
- id: checkCurrentReleaseTag
uses: mukunku/tag-exists-action@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{fromJson(steps.changelog.outputs.content).version}}
- name: Fail if release already exists
run: >-
if [[ ${{ steps.checkCurrentReleaseTag.outputs.exists }} == true ]];
then exit 1; fi
if: github.base_ref == 'unstable' || github.base_ref == 'stable'
- name: Get list of changed files
id: changed_files
run: |2-
list=`git diff --name-only origin/${{github.base_ref}} HEAD | tr '\n' ' '`
echo $list
echo "::set-output name=list::'$list'"
shell: bash
if: >-
github.base_ref == 'develop' || github.base_ref == 'unstable' ||
github.base_ref == 'stable'
- name: Assert if CHANGELOG.md was updated (on pull request)
run: >-
if [[ ${{ contains(steps.changed_files.outputs.list,'CHANGELOG.md') ||
contains(github.event.head_commit.message,'[ci no changelog needed]')
|| contains(github.event.pull_request.body,'[ci no changelog needed]')
}} == false ]]; then exit 1; fi
if: >-
github.base_ref == 'develop' || github.base_ref == 'unstable' ||
github.base_ref == 'stable'
- name: Fail if squash commit to the 'unstable' or the 'stable' branch.
run: >-
if [[ "${{ github.base_ref }}" == "unstable" || "${{ github.base_ref
}}" == "stable" ]]; then exit 1; fi
lint:
name: Linter
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - Linux
- linter
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Install TypeScript
run: npm install -g ts-node@10.1.0
- name: Lint Rust sources
run: node ./run lint --skip-version-validation
test:
name: Native Tests
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - Linux
- test_native
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Install TypeScript
run: npm install -g ts-node@10.1.0
- name: Run tests (no WASM)
run: node ./run test --no-wasm --skip-version-validation
wasm-test:
name: WASM Tests
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - Linux
- test_wasm
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Install TypeScript
run: npm install -g ts-node@10.1.0
- name: Install wasm-pack (macOS)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-apple-darwin
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'macOS')
- name: Install wasm-pack (Windows)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-pc-windows-msvc
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'windows')
- name: Install wasm-pack (Linux)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-unknown-linux-musl
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'ubuntu')
- name: Run tests (WASM)
run: node ./run test --no-native --skip-version-validation
build_wasm:
name: Build WASM
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - Linux
- build_wasm
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Install TypeScript
run: npm install -g ts-node@10.1.0
- name: Install wasm-pack (macOS)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-apple-darwin
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'macOS')
- name: Install wasm-pack (Windows)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-pc-windows-msvc
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'windows')
- name: Install wasm-pack (Linux)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-unknown-linux-musl
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'ubuntu')
- uses: actions/setup-java@v2
with:
distribution: adopt
java-version: "11"
- name: Build WASM
run: node ./run build --no-js --skip-version-validation
- name: Upload IDE WASM artifacts
uses: actions/upload-artifact@v2
with:
name: ide-wasm
path: dist/wasm
package:
name: Build package
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - macOS-latest
- - windows-latest
- - Linux
- package
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Read changelog info
id: changelog
run: |2-
node ./run ci-gen --skip-version-validation
content=`cat CURRENT_RELEASE_CHANGELOG.json`
echo "::set-output name=content::$content"
shell: bash
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0
- name: Install TypeScript
run: npm install -g ts-node@10.1.0
- name: Install wasm-pack (macOS)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-apple-darwin
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'macOS')
- name: Install wasm-pack (Windows)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-pc-windows-msvc
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'windows')
- name: Install wasm-pack (Linux)
env:
WASMPACKURL: https://github.com/rustwasm/wasm-pack/releases/download/v0.9.1
WASMPACKDIR: wasm-pack-v0.9.1-x86_64-unknown-linux-musl
run: |2-
curl -L "$WASMPACKURL/$WASMPACKDIR.tar.gz" | tar -xz -C .
mv $WASMPACKDIR/wasm-pack ~/.cargo/bin
rm -r $WASMPACKDIR
shell: bash
if: startsWith(matrix.os,'ubuntu')
- uses: actions/setup-java@v2
with:
distribution: adopt
java-version: "11"
- name: Download IDE WASM artifacts
uses: actions/download-artifact@v2
with:
name: ide-wasm
path: dist/wasm
- name: Build Package
run: node ./run dist --no-rust --skip-version-validation
shell: bash
env:
CSC_LINK: ${{secrets.APPLE_CODE_SIGNING_CERT}}
CSC_KEY_PASSWORD: ${{secrets.APPLE_CODE_SIGNING_CERT_PASSWORD}}
CSC_IDENTITY_AUTO_DISCOVERY: true
APPLEID: ${{secrets.APPLE_NOTARIZATION_USERNAME}}
APPLEIDPASS: ${{secrets.APPLE_NOTARIZATION_PASSWORD}}
FIREBASE_API_KEY: ${{secrets.FIREBASE_API_KEY}}
WIN_CSC_LINK: ${{secrets.MICROSOFT_CODE_SIGNING_CERT}}
WIN_CSC_KEY_PASSWORD: ${{secrets.MICROSOFT_CODE_SIGNING_CERT_PASSWORD}}
- name: Upload Content Artifacts
uses: actions/upload-artifact@v2
with:
name: content
path: dist/content
if: runner.os == 'Linux'
- name: Upload Artifacts (macOS, dmg)
uses: actions/upload-artifact@v1
with:
name: enso-mac-${{fromJson(steps.changelog.outputs.content).version}}.dmg
path: >-
dist/client/enso-mac-${{fromJson(steps.changelog.outputs.content).version}}.dmg
if: runner.os == 'macOS'
- name: Upload Artifacts (macOS, dmg.sha256)
uses: actions/upload-artifact@v1
with:
name: >-
enso-mac-${{fromJson(steps.changelog.outputs.content).version}}.dmg.sha256
path: >-
dist/client/enso-mac-${{fromJson(steps.changelog.outputs.content).version}}.dmg.sha256
if: runner.os == 'macOS'
- name: Upload Artifacts (Windows, exe)
uses: actions/upload-artifact@v1
with:
name: enso-win-${{fromJson(steps.changelog.outputs.content).version}}.exe
path: >-
dist/client/enso-win-${{fromJson(steps.changelog.outputs.content).version}}.exe
if: runner.os == 'Windows'
- name: Upload Artifacts (Windows, exe.sha256)
uses: actions/upload-artifact@v1
with:
name: >-
enso-win-${{fromJson(steps.changelog.outputs.content).version}}.exe.sha256
path: >-
dist/client/enso-win-${{fromJson(steps.changelog.outputs.content).version}}.exe.sha256
if: runner.os == 'Windows'
- name: Upload Artifacts (Linux, AppImage)
uses: actions/upload-artifact@v1
with:
name: >-
enso-linux-${{fromJson(steps.changelog.outputs.content).version}}.AppImage
path: >-
dist/client/enso-linux-${{fromJson(steps.changelog.outputs.content).version}}.AppImage
if: runner.os == 'Linux'
- name: Upload Artifacts (Linux, AppImage.sha256)
uses: actions/upload-artifact@v1
with:
name: >-
enso-linux-${{fromJson(steps.changelog.outputs.content).version}}.AppImage.sha256
path: >-
dist/client/enso-linux-${{fromJson(steps.changelog.outputs.content).version}}.AppImage.sha256
if: runner.os == 'Linux'
needs:
- build_wasm
release_to_github:
name: GitHub Release
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- - macOS-latest
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Read changelog info
id: changelog
run: |2-
node ./run ci-gen --skip-version-validation
content=`cat CURRENT_RELEASE_CHANGELOG.json`
echo "::set-output name=content::$content"
shell: bash
- id: checkCurrentReleaseTag
uses: mukunku/tag-exists-action@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{fromJson(steps.changelog.outputs.content).version}}
- name: Fail if release already exists
run: >-
if [[ ${{ steps.checkCurrentReleaseTag.outputs.exists }} == true ]];
then exit 1; fi
if: github.base_ref == 'unstable' || github.base_ref == 'stable'
- name: Upload GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: artifacts/**/enso-*
name: Enso ${{fromJson(steps.changelog.outputs.content).version}}
tag_name: v${{fromJson(steps.changelog.outputs.content).version}}
body: ${{fromJson(steps.changelog.outputs.content).body}}
prerelease: ${{fromJson(steps.changelog.outputs.content).prerelease}}
draft: true
if: github.ref == 'refs/heads/unstable' || github.ref == 'refs/heads/stable'
needs:
- version_assertions
- lint
- test
- package
release_to_cdn:
name: CDN Release
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- ubuntu-18.04
fail-fast: false
steps:
- uses: actions/checkout@v1
with:
clean: false
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Read changelog info
id: changelog
run: |2-
node ./run ci-gen --skip-version-validation
content=`cat CURRENT_RELEASE_CHANGELOG.json`
echo "::set-output name=content::$content"
shell: bash
- shell: bash
run: |2-
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
${{ secrets.ARTEFACT_S3_ACCESS_KEY_ID }}
${{ secrets.ARTEFACT_S3_SECRET_ACCESS_KEY }}
us-west-1
text
EOF
- name: Upload 'index.js.gz' to CDN
shell: bash
run: >-
aws s3 cp ./artifacts/content/assets/index.js.gz
s3://ensocdn/ide/${{fromJson(steps.changelog.outputs.content).version}}/index.js.gz
--profile s3-upload --acl public-read --content-encoding gzip
- name: Upload 'style.css' to CDN
shell: bash
run: >-
aws s3 cp ./artifacts/content/assets/style.css
s3://ensocdn/ide/${{fromJson(steps.changelog.outputs.content).version}}/style.css
--profile s3-upload --acl public-read
- name: Upload 'ide.wasm' to CDN
shell: bash
run: >-
aws s3 cp ./artifacts/content/assets/ide.wasm
s3://ensocdn/ide/${{fromJson(steps.changelog.outputs.content).version}}/ide.wasm
--profile s3-upload --acl public-read --content-type
'application/wasm'
- name: Upload 'wasm_imports.js.gz' to CDN
shell: bash
run: >-
aws s3 cp ./artifacts/content/assets/wasm_imports.js.gz
s3://ensocdn/ide/${{fromJson(steps.changelog.outputs.content).version}}/wasm_imports.js.gz
--profile s3-upload --acl public-read --content-encoding gzip
if: github.ref == 'refs/heads/unstable' || github.ref == 'refs/heads/stable'
needs:
- version_assertions
- lint
- test
- package