mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-20 20:05:34 +00:00
build(ci): call VS Code CI tasks in release.yml workflow (#1920)
Since this PR, CI runs VS Code tasks exact after built binaries and before `dist host`. This is to ensure that the vscode artifacts are available when undraft the releases.
This commit is contained in:
parent
315168da1f
commit
e9ae352dfd
7 changed files with 338 additions and 314 deletions
181
.github/workflows/build-vscode-main.yml
vendored
Normal file
181
.github/workflows/build-vscode-main.yml
vendored
Normal file
|
|
@ -0,0 +1,181 @@
|
||||||
|
name: tinymist::build::vscode::main
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows-latest
|
||||||
|
rust-target: x86_64-pc-windows-msvc
|
||||||
|
platform: win32
|
||||||
|
arch: x64
|
||||||
|
regular_build: 'true'
|
||||||
|
- os: windows-latest
|
||||||
|
rust-target: aarch64-pc-windows-msvc
|
||||||
|
platform: win32
|
||||||
|
arch: arm64
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
rust-target: x86_64-unknown-linux-gnu
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
regular_build: 'true'
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
rust-target: aarch64-unknown-linux-gnu
|
||||||
|
platform: linux
|
||||||
|
arch: arm64
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
rust-target: arm-unknown-linux-gnueabihf
|
||||||
|
platform: linux
|
||||||
|
arch: armhf
|
||||||
|
- os: macos-13
|
||||||
|
rust-target: x86_64-apple-darwin
|
||||||
|
platform: darwin
|
||||||
|
arch: x64
|
||||||
|
- os: macos-13
|
||||||
|
rust-target: aarch64-apple-darwin
|
||||||
|
platform: darwin
|
||||||
|
arch: arm64
|
||||||
|
regular_build: 'true'
|
||||||
|
name: build (${{ matrix.platform }}-${{ matrix.arch }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
target: ${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
|
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
|
||||||
|
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8'))))) || (!startsWith(github.ref, 'refs/tags/') && matrix.regular_build == 'true')) }}
|
||||||
|
isTest: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' || matrix.rust-target == 'x86_64-pc-windows-msvc' }}
|
||||||
|
isUniversal: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' }}
|
||||||
|
steps:
|
||||||
|
- name: "Print Env"
|
||||||
|
run: |
|
||||||
|
echo "Running on ${{ matrix.os }}"
|
||||||
|
echo "Target: ${{ env.target }}"
|
||||||
|
echo "Is Release: ${{ fromJson(env.isRelease) }}"
|
||||||
|
echo "Is Nightly: ${{ fromJson(env.isNightly) }}"
|
||||||
|
echo "Is Test: ${{ fromJson(env.isTest) }}"
|
||||||
|
echo "Is Universal (No Server): ${{ fromJson(env.isUniversal) }}"
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: 'yarn'
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
- name: Install deps
|
||||||
|
run: yarn install
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
|
||||||
|
- name: Download tinymist binary artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: artifacts-build-local-${{ matrix.rust-target }}
|
||||||
|
path: prebuilts
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
- name: Unzip tinymist binary artifact (Windows)
|
||||||
|
run: 7z x -y -oprebuilts prebuilts/tinymist-${{ matrix.rust-target }}.zip
|
||||||
|
if: matrix.platform == 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
- name: Unzip tinymist binary artifact (Linux)
|
||||||
|
run: |
|
||||||
|
tar -xvf prebuilts/tinymist-${{ matrix.rust-target }}.tar.gz -C prebuilts
|
||||||
|
mv prebuilts/tinymist-${{ matrix.rust-target }}/tinymist prebuilts/tinymist
|
||||||
|
if: matrix.platform != 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
|
||||||
|
- name: Download VSC Assets
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: vscode-artifacts-tinymist
|
||||||
|
path: editors/vscode/out
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
- name: Download VSC Assets (L10n)
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: vscode-artifacts-tinymist-l10n
|
||||||
|
path: editors/vscode
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
- name: Download VSC Assets (Preview)
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: vscode-artifacts-typst-preview
|
||||||
|
path: contrib/typst-preview/editors/vscode/out
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
|
||||||
|
- name: Copy binary to output directory
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
run: |
|
||||||
|
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "editors/vscode/out/"
|
||||||
|
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "contrib/typst-preview/editors/vscode/out/"
|
||||||
|
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "tinymist-${{ env.target }}${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}"
|
||||||
|
|
||||||
|
- name: Package typst-preview extension
|
||||||
|
if: fromJson(env.isRelease)
|
||||||
|
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix
|
||||||
|
working-directory: ./contrib/typst-preview/editors/vscode
|
||||||
|
- name: Package tinymist extension
|
||||||
|
if: fromJson(env.isRelease)
|
||||||
|
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
|
||||||
|
working-directory: ./editors/vscode
|
||||||
|
- name: Package typst-preview extension (Nightly)
|
||||||
|
if: fromJson(env.isNightly)
|
||||||
|
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix --pre-release
|
||||||
|
working-directory: ./contrib/typst-preview/editors/vscode
|
||||||
|
- name: Package tinymist extension (Nightly)
|
||||||
|
if: fromJson(env.isNightly)
|
||||||
|
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix --pre-release
|
||||||
|
working-directory: ./editors/vscode
|
||||||
|
|
||||||
|
- name: Upload binary artifact
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tinymist-${{ env.target }}
|
||||||
|
path: tinymist-${{ env.target }}${{ fromJSON('["", ".exe"]')[matrix.platform == 'win32'] }}
|
||||||
|
- name: Upload typst-preview VSIX artifact
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: typst-preview-${{ env.target }}.vsix
|
||||||
|
path: contrib/typst-preview/editors/vscode/typst-preview-${{ env.target }}.vsix
|
||||||
|
- name: Upload VSIX artifact
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tinymist-${{ env.target }}.vsix
|
||||||
|
path: editors/vscode/tinymist-${{ env.target }}.vsix
|
||||||
|
|
||||||
|
- name: Test tinymist extension
|
||||||
|
uses: coactions/setup-xvfb@v1
|
||||||
|
with:
|
||||||
|
run: yarn test
|
||||||
|
working-directory: ./editors/vscode
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest)
|
||||||
|
- name: Upload Tinymist Testing log
|
||||||
|
if: ${{ always() && ((fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest))}}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tinymist-lsp-tests.${{ env.target }}.log
|
||||||
|
path: editors/vscode/e2e-workspaces/simple-docs/tinymist-lsp.log
|
||||||
|
|
||||||
|
# The universal target doesn't bundle the binary. Users of that must install
|
||||||
|
# tinymist by themselves.
|
||||||
|
- name: Remove server binary
|
||||||
|
if: fromJson(env.isUniversal)
|
||||||
|
run: rm "editors/vscode/out/tinymist"
|
||||||
|
- name: Package extension (Universal)
|
||||||
|
if: fromJson(env.isRelease) && fromJson(env.isUniversal)
|
||||||
|
run: yarn run package -- -o tinymist-universal.vsix
|
||||||
|
working-directory: ./editors/vscode
|
||||||
|
- name: Package extension (Universal, Nightly)
|
||||||
|
if: fromJson(env.isNightly) && fromJson(env.isUniversal)
|
||||||
|
run: yarn run package -- -o tinymist-universal.vsix --pre-release
|
||||||
|
working-directory: ./editors/vscode
|
||||||
|
- name: Upload tinymist VSIX artifact (Universal)
|
||||||
|
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isUniversal)
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: tinymist-universal.vsix
|
||||||
|
path: editors/vscode/tinymist-universal.vsix
|
||||||
231
.github/workflows/build-vscode.yml
vendored
231
.github/workflows/build-vscode.yml
vendored
|
|
@ -1,182 +1,91 @@
|
||||||
|
|
||||||
name: tinymist::build::vscode
|
name: tinymist::build::vscode
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
VSCODE_MARKETPLACE_TOKEN:
|
||||||
|
required: true
|
||||||
|
OPENVSX_ACCESS_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: '-Dwarnings'
|
||||||
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
|
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-vsc-assets:
|
||||||
strategy:
|
uses: ./.github/workflows/build-vsc-assets.yml
|
||||||
matrix:
|
|
||||||
include:
|
build-vscode-main:
|
||||||
- os: windows-latest
|
needs: [build-vsc-assets]
|
||||||
rust-target: x86_64-pc-windows-msvc
|
uses: ./.github/workflows/build-vscode-main.yml
|
||||||
platform: win32
|
|
||||||
arch: x64
|
build-vscode-others:
|
||||||
regular_build: 'true'
|
needs: [build-vsc-assets]
|
||||||
- os: windows-latest
|
uses: ./.github/workflows/build-vscode-others.yml
|
||||||
rust-target: aarch64-pc-windows-msvc
|
|
||||||
platform: win32
|
release:
|
||||||
arch: arm64
|
needs: [build-vscode-main, build-vscode-others] # , announce
|
||||||
- os: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
rust-target: x86_64-unknown-linux-gnu
|
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||||
platform: linux
|
permissions:
|
||||||
arch: x64
|
contents: write
|
||||||
regular_build: 'true'
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
rust-target: aarch64-unknown-linux-gnu
|
|
||||||
platform: linux
|
|
||||||
arch: arm64
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
rust-target: arm-unknown-linux-gnueabihf
|
|
||||||
platform: linux
|
|
||||||
arch: armhf
|
|
||||||
- os: macos-13
|
|
||||||
rust-target: x86_64-apple-darwin
|
|
||||||
platform: darwin
|
|
||||||
arch: x64
|
|
||||||
- os: macos-13
|
|
||||||
rust-target: aarch64-apple-darwin
|
|
||||||
platform: darwin
|
|
||||||
arch: arm64
|
|
||||||
regular_build: 'true'
|
|
||||||
name: build (${{ matrix.platform }}-${{ matrix.arch }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
target: ${{ matrix.platform }}-${{ matrix.arch }}
|
|
||||||
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
|
|
||||||
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8'))))) || (!startsWith(github.ref, 'refs/tags/') && matrix.regular_build == 'true')) }}
|
|
||||||
isTest: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' || matrix.rust-target == 'x86_64-pc-windows-msvc' }}
|
|
||||||
isUniversal: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Print Env"
|
|
||||||
run: |
|
|
||||||
echo "Running on ${{ matrix.os }}"
|
|
||||||
echo "Target: ${{ env.target }}"
|
|
||||||
echo "Is Release: ${{ fromJson(env.isRelease) }}"
|
|
||||||
echo "Is Nightly: ${{ fromJson(env.isNightly) }}"
|
|
||||||
echo "Is Test: ${{ fromJson(env.isTest) }}"
|
|
||||||
echo "Is Universal (No Server): ${{ fromJson(env.isUniversal) }}"
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
pattern: '{tinymist,typst-preview}-*'
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R artifacts
|
||||||
|
- uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
artifacts: "artifacts/*/*"
|
||||||
|
allowUpdates: true
|
||||||
|
omitBodyDuringUpdate: true
|
||||||
|
omitDraftDuringUpdate: true
|
||||||
|
omitNameDuringUpdate: true
|
||||||
|
omitPrereleaseDuringUpdate: true
|
||||||
|
|
||||||
|
publish:
|
||||||
|
needs: [build-vscode-main, build-vscode-others] # , announce
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
|
||||||
|
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))))) }}
|
||||||
|
if: success() && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc')
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: yarn install
|
run: yarn install
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
- name: Deploy to VS Code Marketplace
|
||||||
|
|
||||||
- name: Download tinymist binary artifact
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: artifacts-build-local-${{ matrix.rust-target }}
|
|
||||||
path: prebuilts
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
- name: Unzip tinymist binary artifact (Windows)
|
|
||||||
run: 7z x -y -oprebuilts prebuilts/tinymist-${{ matrix.rust-target }}.zip
|
|
||||||
if: matrix.platform == 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
- name: Unzip tinymist binary artifact (Linux)
|
|
||||||
run: |
|
|
||||||
tar -xvf prebuilts/tinymist-${{ matrix.rust-target }}.tar.gz -C prebuilts
|
|
||||||
mv prebuilts/tinymist-${{ matrix.rust-target }}/tinymist prebuilts/tinymist
|
|
||||||
if: matrix.platform != 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
|
|
||||||
- name: Download VSC Assets
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: vscode-artifacts-tinymist
|
|
||||||
path: editors/vscode/out
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
- name: Download VSC Assets (L10n)
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: vscode-artifacts-tinymist-l10n
|
|
||||||
path: editors/vscode
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
- name: Download VSC Assets (Preview)
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: vscode-artifacts-typst-preview
|
|
||||||
path: contrib/typst-preview/editors/vscode/out
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
|
|
||||||
- name: Copy binary to output directory
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
run: |
|
|
||||||
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "editors/vscode/out/"
|
|
||||||
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "contrib/typst-preview/editors/vscode/out/"
|
|
||||||
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "tinymist-${{ env.target }}${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}"
|
|
||||||
|
|
||||||
- name: Package typst-preview extension
|
|
||||||
if: fromJson(env.isRelease)
|
if: fromJson(env.isRelease)
|
||||||
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix
|
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
|
||||||
working-directory: ./contrib/typst-preview/editors/vscode
|
env:
|
||||||
- name: Package tinymist extension
|
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
|
||||||
|
- name: Deploy to OpenVSX
|
||||||
if: fromJson(env.isRelease)
|
if: fromJson(env.isRelease)
|
||||||
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
|
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
|
||||||
working-directory: ./editors/vscode
|
env:
|
||||||
- name: Package typst-preview extension (Nightly)
|
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
|
||||||
|
- name: Deploy to VS Code Marketplace (Nightly)
|
||||||
if: fromJson(env.isNightly)
|
if: fromJson(env.isNightly)
|
||||||
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix --pre-release
|
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
|
||||||
working-directory: ./contrib/typst-preview/editors/vscode
|
env:
|
||||||
- name: Package tinymist extension (Nightly)
|
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
|
||||||
|
- name: Deploy to OpenVSX (Nightly)
|
||||||
if: fromJson(env.isNightly)
|
if: fromJson(env.isNightly)
|
||||||
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix --pre-release
|
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
|
||||||
working-directory: ./editors/vscode
|
env:
|
||||||
|
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
|
||||||
- name: Upload binary artifact
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tinymist-${{ env.target }}
|
|
||||||
path: tinymist-${{ env.target }}${{ fromJSON('["", ".exe"]')[matrix.platform == 'win32'] }}
|
|
||||||
- name: Upload typst-preview VSIX artifact
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: typst-preview-${{ env.target }}.vsix
|
|
||||||
path: contrib/typst-preview/editors/vscode/typst-preview-${{ env.target }}.vsix
|
|
||||||
- name: Upload VSIX artifact
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tinymist-${{ env.target }}.vsix
|
|
||||||
path: editors/vscode/tinymist-${{ env.target }}.vsix
|
|
||||||
|
|
||||||
- name: Test tinymist extension
|
|
||||||
uses: coactions/setup-xvfb@v1
|
|
||||||
with:
|
|
||||||
run: yarn test
|
|
||||||
working-directory: ./editors/vscode
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest)
|
|
||||||
- name: Upload Tinymist Testing log
|
|
||||||
if: ${{ always() && ((fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest))}}
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tinymist-lsp-tests.${{ env.target }}.log
|
|
||||||
path: editors/vscode/e2e-workspaces/simple-docs/tinymist-lsp.log
|
|
||||||
|
|
||||||
# The universal target doesn't bundle the binary. Users of that must install
|
|
||||||
# tinymist by themselves.
|
|
||||||
- name: Remove server binary
|
|
||||||
if: fromJson(env.isUniversal)
|
|
||||||
run: rm "editors/vscode/out/tinymist"
|
|
||||||
- name: Package extension (Universal)
|
|
||||||
if: fromJson(env.isRelease) && fromJson(env.isUniversal)
|
|
||||||
run: yarn run package -- -o tinymist-universal.vsix
|
|
||||||
working-directory: ./editors/vscode
|
|
||||||
- name: Package extension (Universal, Nightly)
|
|
||||||
if: fromJson(env.isNightly) && fromJson(env.isUniversal)
|
|
||||||
run: yarn run package -- -o tinymist-universal.vsix --pre-release
|
|
||||||
working-directory: ./editors/vscode
|
|
||||||
- name: Upload tinymist VSIX artifact (Universal)
|
|
||||||
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isUniversal)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: tinymist-universal.vsix
|
|
||||||
path: editors/vscode/tinymist-universal.vsix
|
|
||||||
59
.github/workflows/ci-check-e2e.yml
vendored
Normal file
59
.github/workflows/ci-check-e2e.yml
vendored
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
name: tinymist::check-e2e
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: '-Dwarnings'
|
||||||
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
|
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checks-e2e:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: windows-2022
|
||||||
|
rust-target: x86_64-pc-windows-msvc
|
||||||
|
platform: win32
|
||||||
|
arch: x64
|
||||||
|
- os: windows-latest
|
||||||
|
rust-target: x86_64-pc-windows-msvc
|
||||||
|
platform: win32
|
||||||
|
arch: x64
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
rust-target: x86_64-unknown-linux-gnu
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
- os: ubuntu-latest
|
||||||
|
rust-target: x86_64-unknown-linux-gnu
|
||||||
|
platform: linux
|
||||||
|
arch: x64
|
||||||
|
- os: macos-latest
|
||||||
|
rust-target: aarch64-apple-darwin
|
||||||
|
platform: darwin
|
||||||
|
arch: arm64
|
||||||
|
name: E2E Tests (${{ matrix.platform }}-${{ matrix.arch }} on ${{ matrix.os }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Download tinymist binary artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: artifacts-build-local-${{ matrix.rust-target }}
|
||||||
|
path: editors/vscode/out
|
||||||
|
- name: Unzip tinymist binary artifact (Windows)
|
||||||
|
run: 7z x -y -oeditors/vscode/out editors/vscode/out/tinymist-${{ matrix.rust-target }}.zip
|
||||||
|
if: matrix.platform == 'win32'
|
||||||
|
- name: Unzip tinymist binary artifact (Linux)
|
||||||
|
run: |
|
||||||
|
tar -xvf editors/vscode/out/tinymist-${{ matrix.rust-target }}.tar.gz -C editors/vscode/out
|
||||||
|
mv editors/vscode/out/tinymist-${{ matrix.rust-target }}/tinymist editors/vscode/out/tinymist
|
||||||
|
if: matrix.platform != 'win32'
|
||||||
|
- name: Test Tinymist (E2E)
|
||||||
|
run: cargo test -p tests -- e2e
|
||||||
|
- name: Upload Tinymist E2E Test Snapshot
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: e2e-snapshot-${{ matrix.rust-target }}-${{ matrix.os }}
|
||||||
|
path: target/e2e
|
||||||
76
.github/workflows/ci.yml
vendored
76
.github/workflows/ci.yml
vendored
|
|
@ -101,57 +101,6 @@ jobs:
|
||||||
- name: Test tinymist
|
- name: Test tinymist
|
||||||
run: cargo test --workspace -- --skip=e2e
|
run: cargo test --workspace -- --skip=e2e
|
||||||
|
|
||||||
checks-e2e:
|
|
||||||
needs: [build-binary]
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: windows-2022
|
|
||||||
rust-target: x86_64-pc-windows-msvc
|
|
||||||
platform: win32
|
|
||||||
arch: x64
|
|
||||||
- os: windows-latest
|
|
||||||
rust-target: x86_64-pc-windows-msvc
|
|
||||||
platform: win32
|
|
||||||
arch: x64
|
|
||||||
- os: ubuntu-22.04
|
|
||||||
rust-target: x86_64-unknown-linux-gnu
|
|
||||||
platform: linux
|
|
||||||
arch: x64
|
|
||||||
- os: ubuntu-latest
|
|
||||||
rust-target: x86_64-unknown-linux-gnu
|
|
||||||
platform: linux
|
|
||||||
arch: x64
|
|
||||||
- os: macos-latest
|
|
||||||
rust-target: aarch64-apple-darwin
|
|
||||||
platform: darwin
|
|
||||||
arch: arm64
|
|
||||||
name: E2E Tests (${{ matrix.platform }}-${{ matrix.arch }} on ${{ matrix.os }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Download tinymist binary artifact
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: artifacts-build-local-${{ matrix.rust-target }}
|
|
||||||
path: editors/vscode/out
|
|
||||||
- name: Unzip tinymist binary artifact (Windows)
|
|
||||||
run: 7z x -y -oeditors/vscode/out editors/vscode/out/tinymist-${{ matrix.rust-target }}.zip
|
|
||||||
if: matrix.platform == 'win32'
|
|
||||||
- name: Unzip tinymist binary artifact (Linux)
|
|
||||||
run: |
|
|
||||||
tar -xvf editors/vscode/out/tinymist-${{ matrix.rust-target }}.tar.gz -C editors/vscode/out
|
|
||||||
mv editors/vscode/out/tinymist-${{ matrix.rust-target }}/tinymist editors/vscode/out/tinymist
|
|
||||||
if: matrix.platform != 'win32'
|
|
||||||
- name: Test Tinymist (E2E)
|
|
||||||
run: cargo test -p tests -- e2e
|
|
||||||
- name: Upload Tinymist E2E Test Snapshot
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: e2e-snapshot-${{ matrix.rust-target }}-${{ matrix.os }}
|
|
||||||
path: target/e2e
|
|
||||||
|
|
||||||
prepare-build:
|
prepare-build:
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
outputs:
|
outputs:
|
||||||
|
|
@ -170,33 +119,12 @@ jobs:
|
||||||
# with:
|
# with:
|
||||||
# tag: ${{ needs.prepare-build.outputs.tag }}
|
# tag: ${{ needs.prepare-build.outputs.tag }}
|
||||||
|
|
||||||
build-binary:
|
build:
|
||||||
needs: [prepare-build] # , announce
|
needs: [prepare-build] # , announce
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
uses: ./.github/workflows/release.yml
|
uses: ./.github/workflows/release.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
tag: ${{ (startsWith(github.ref, 'refs/tags/') && needs.prepare-build.outputs.tag) || '' }}
|
tag: ${{ (startsWith(github.ref, 'refs/tags/') && needs.prepare-build.outputs.tag) || '' }}
|
||||||
targets: ${{ (!startsWith(github.ref, 'refs/tags/') && 'aarch64-apple-darwin,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu') || 'all' }}
|
targets: ${{ (!startsWith(github.ref, 'refs/tags/') && 'aarch64-apple-darwin,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu') || 'all' }}
|
||||||
|
|
||||||
build-vsc-assets:
|
|
||||||
needs: [build-binary]
|
|
||||||
uses: ./.github/workflows/build-vsc-assets.yml
|
|
||||||
|
|
||||||
build-vscode:
|
|
||||||
needs: [build-binary, build-vsc-assets]
|
|
||||||
uses: ./.github/workflows/build-vscode.yml
|
|
||||||
|
|
||||||
build-vscode-others:
|
|
||||||
needs: [build-vsc-assets]
|
|
||||||
uses: ./.github/workflows/build-vscode-others.yml
|
|
||||||
|
|
||||||
publish-vscode:
|
|
||||||
needs: [build-vscode, build-vscode-others] # , announce
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
uses: ./.github/workflows/publish-vscode.yml
|
|
||||||
secrets:
|
|
||||||
VSCODE_MARKETPLACE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
|
|
||||||
OPENVSX_ACCESS_TOKEN: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
|
|
||||||
|
|
||||||
78
.github/workflows/publish-vscode.yml
vendored
78
.github/workflows/publish-vscode.yml
vendored
|
|
@ -1,78 +0,0 @@
|
||||||
name: tinymist::vscode::pubish
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
VSCODE_MARKETPLACE_TOKEN:
|
|
||||||
required: true
|
|
||||||
OPENVSX_ACCESS_TOKEN:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
env:
|
|
||||||
RUSTFLAGS: '-Dwarnings'
|
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
||||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: artifacts
|
|
||||||
pattern: '{tinymist,typst-preview}-*'
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R artifacts
|
|
||||||
- uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
artifacts: "artifacts/*/*"
|
|
||||||
allowUpdates: true
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitDraftDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
|
|
||||||
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))))) }}
|
|
||||||
if: success() && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc')
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
cache: 'yarn'
|
|
||||||
- name: Install deps
|
|
||||||
run: yarn install
|
|
||||||
- name: Deploy to VS Code Marketplace
|
|
||||||
if: fromJson(env.isRelease)
|
|
||||||
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
|
|
||||||
env:
|
|
||||||
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
|
|
||||||
- name: Deploy to OpenVSX
|
|
||||||
if: fromJson(env.isRelease)
|
|
||||||
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
|
|
||||||
env:
|
|
||||||
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
|
|
||||||
- name: Deploy to VS Code Marketplace (Nightly)
|
|
||||||
if: fromJson(env.isNightly)
|
|
||||||
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
|
|
||||||
env:
|
|
||||||
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
|
|
||||||
- name: Deploy to OpenVSX (Nightly)
|
|
||||||
if: fromJson(env.isNightly)
|
|
||||||
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
|
|
||||||
env:
|
|
||||||
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
|
|
||||||
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
|
|
@ -236,14 +236,36 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
${{ steps.cargo-dist.outputs.paths }}
|
${{ steps.cargo-dist.outputs.paths }}
|
||||||
${{ env.BUILD_MANIFEST_NAME }}
|
${{ env.BUILD_MANIFEST_NAME }}
|
||||||
|
|
||||||
|
custom-build-vscode:
|
||||||
|
needs:
|
||||||
|
- plan
|
||||||
|
- build-local-artifacts
|
||||||
|
uses: ./.github/workflows/build-vscode.yml
|
||||||
|
with:
|
||||||
|
plan: ${{ needs.plan.outputs.val }}
|
||||||
|
secrets: inherit
|
||||||
|
permissions:
|
||||||
|
"contents": "write"
|
||||||
|
|
||||||
|
custom-ci-check-e2e:
|
||||||
|
needs:
|
||||||
|
- plan
|
||||||
|
- build-local-artifacts
|
||||||
|
uses: ./.github/workflows/ci-check-e2e.yml
|
||||||
|
with:
|
||||||
|
plan: ${{ needs.plan.outputs.val }}
|
||||||
|
secrets: inherit
|
||||||
# Determines if we should publish/announce
|
# Determines if we should publish/announce
|
||||||
host:
|
host:
|
||||||
needs:
|
needs:
|
||||||
- plan
|
- plan
|
||||||
- build-local-artifacts
|
- build-local-artifacts
|
||||||
- build-global-artifacts
|
- build-global-artifacts
|
||||||
|
- custom-build-vscode
|
||||||
|
- custom-ci-check-e2e
|
||||||
# Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
|
# Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
|
||||||
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
|
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.custom-build-vscode.result == 'skipped' || needs.custom-build-vscode.result == 'success') && (needs.custom-ci-check-e2e.result == 'skipped' || needs.custom-ci-check-e2e.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
runs-on: "ubuntu-22.04"
|
runs-on: "ubuntu-22.04"
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]
|
||||||
# Whether to cache builds
|
# Whether to cache builds
|
||||||
cache-builds = true
|
cache-builds = true
|
||||||
|
|
||||||
|
global-artifacts-jobs = ["./build-vscode", "./ci-check-e2e"]
|
||||||
|
github-custom-job-permissions = { "build-vscode" = { contents = "write" } }
|
||||||
|
|
||||||
[dist.min-glibc-version]
|
[dist.min-glibc-version]
|
||||||
# Override glibc version for specific target triplets.
|
# Override glibc version for specific target triplets.
|
||||||
aarch64-unknown-linux-gnu = "2.28"
|
aarch64-unknown-linux-gnu = "2.28"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue