Fix channelcreate/remove static/add dockerfile #24
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: CI | |
on: | |
push: | |
branches: ["dev"] | |
pull_request: | |
branches: ["dev"] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- { | |
name: ubuntu-latest, | |
binary_name: shiki-server, | |
output_name: shiki-server-linux-amd64, | |
} | |
- { | |
name: macos-latest, | |
binary_name: shiki-server, | |
output_name: shiki-server-macos-amd64, | |
} | |
- { | |
name: windows-latest, | |
binary_name: shiki-server.exe, | |
output_name: shiki-server-windows-amd64, | |
} | |
name: build-${{ matrix.os.name }} | |
runs-on: ${{ matrix.os.name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Add MSBuild to PATH | |
if: runner.os == 'Windows' | |
uses: microsoft/[email protected] | |
- name: Install Dependencies | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt update | |
sudo apt install -y cmake clang libssl-dev pkg-config | |
fi | |
shell: bash | |
- name: Select Python 3.10 | |
if: runner.os == 'macOS' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Conan | |
uses: turtlebrowser/get-conan@main | |
with: | |
version: 1.60.0 | |
- name: Set up Clang | |
if: runner.os == 'Windows' | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: latest | |
platform: x64 | |
- name: Install OpenSSL | |
if: runner.os == 'Windows' | |
uses: johnwason/vcpkg-action@v5 | |
id: vcpkg | |
with: | |
pkgs: openssl | |
triplet: x64-windows-static | |
cache-key: ${{ runner.os }}-vcpkg | |
token: ${{ github.token }} | |
- name: Add VCPKG_ROOT and OPENSSL env vars | |
if: runner.os == 'Windows' | |
run: | | |
echo "OPENSSL_NO_VENDOR=1" | Out-File -FilePath $env:GITHUB_ENV -Append | |
echo "OPENSSL_DIR=${{ github.workspace }}\vcpkg\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append | |
echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Lint | |
run: | | |
cargo fmt --all -- --check | |
cargo clippy -- -D warnings | |
- name: Install cargo-binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install cargo check tools | |
run: | | |
which cargo-deny || cargo binstall cargo-deny | |
which cargo-outdated || cargo binstall cargo-outdated | |
which cargo-udeps || cargo binstall cargo-udeps | |
which cargo-audit || cargo binstall cargo-audit | |
which cargo-pants || cargo binstall cargo-pants | |
# - name: Check | |
# run: | | |
# cargo deny check | |
# cargo outdated --exit-code 1 | |
# cargo udeps | |
# rm -rf ~/.cargo/advisory-db | |
# cargo audit | |
# cargo pants | |
- name: Build | |
run: cargo build --verbose --release | |
- name: Upload binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os.output_name }} | |
path: ./target/release/${{ matrix.os.binary_name }} | |
release: | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- { name: ubuntu-latest, binary_name: shiki-server-linux-amd64 } | |
- { name: macos-latest, binary_name: shiki-server-macos-amd64 } | |
- { name: windows-latest, binary_name: shiki-server-windows-amd64 } | |
name: release-${{ matrix.os.name }} | |
runs-on: ${{ matrix.os.name }} | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Next Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: dev | |
- name: Create Draft Release | |
uses: ncipollo/[email protected] | |
with: | |
prerelease: true | |
draft: false | |
commit: ${{ github.sha }} | |
tag: ${{ steps.semver.outputs.next }}-dev | |
name: ${{ steps.semver.outputs.next }}-dev | |
body: "*pending*" | |
token: ${{ github.token }} | |
- name: Update CHANGELOG | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
tag: ${{ steps.semver.outputs.next }}-dev | |
writeToFile: false | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
prerelease: true | |
allowUpdates: true | |
draft: false | |
makeLatest: true | |
commit: ${{ github.sha }} | |
tag: ${{ steps.semver.outputs.next }}-dev | |
name: ${{ steps.semver.outputs.next }}-dev | |
body: ${{ steps.changelog.outputs.changes }} | |
token: ${{ github.token }} | |
- name: Download binaries | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.os.binary_name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ github.token }} | |
file: ${{ matrix.os.binary_name }} | |
asset_name: ${{ matrix.os.binary_name }}-${{ matrix.os.name }} | |
tag: ${{ steps.semver.outputs.next }}-dev |