chore: v0.3.2 #5
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: release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: write | |
jobs: | |
crates: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Publish crates | |
run: | | |
if ! git show --exit-code -G^version crates/syntax/Cargo.toml; then | |
cargo publish -p wat_syntax | |
fi | |
if ! git show --exit-code -G^version crates/parser/Cargo.toml; then | |
cargo publish -p wat_parser | |
fi | |
if ! git show --exit-code -G^version crates/formatter/Cargo.toml; then | |
cargo publish -p wat_formatter | |
fi | |
cargo publish -p wat_service | |
cargo publish -p wat_server | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
github: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: x86_64-macos | |
host: macos-latest | |
target: x86_64-apple-darwin | |
- name: arm64-macos | |
host: macos-latest | |
target: aarch64-apple-darwin | |
- name: x86_64-linux | |
host: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- name: x86_64-windows | |
host: windows-latest | |
target: x86_64-pc-windows-gnu | |
name: ${{ matrix.target }} | |
runs-on: ${{ matrix.host }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- shell: pwsh | |
run: | | |
cargo build --target=${{ matrix.target }} --release | |
if (Test-Path ./target/${{ matrix.target }}/release/wat_server.exe) { | |
7z a wat_server-${{ matrix.name }}.zip ./target/${{ matrix.target }}/release/wat_server.exe | |
} | |
elseif (Test-Path ./target/${{ matrix.target }}/release/wat_server) { | |
7z a wat_server-${{ matrix.name }}.zip ./target/${{ matrix.target }}/release/wat_server | |
} | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
wat_server-${{ matrix.name }}.zip | |
- name: Release VS Code Extension | |
if: matrix.host == 'windows-latest' # Windows is slowest | |
run: | | |
$headers = @{ | |
"Accept" = "application/vnd.github+json" | |
"Authorization" = "Bearer ${{ secrets.VSCODE_EXT_REPO_TOKEN }}" | |
"X-GitHub-Api-Version" = "2022-11-28" | |
} | |
$body = @{ | |
"ref" = "main" | |
"inputs" = @{ | |
"semver" = "minor" | |
} | |
} | ConvertTo-Json | |
Invoke-WebRequest -Uri "https://api.github.com/repos/g-plane/vscode-wasm/actions/workflows/release.yml/dispatches" -Method Post -Headers $headers -Body $body |