Skip to content

v0.1.21

v0.1.21 #57

Workflow file for this run

name: release
on:
release:
types: [published]
workflow_dispatch:
jobs:
wait:
runs-on: ubuntu-latest
steps:
- name: Wait for checks to succeed
uses: poseidon/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
interval: 5
dist:
strategy:
# don't cancel other jobs when one fails
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- os: ubuntu-20.04
target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
name: dist (${{ matrix.target }})
runs-on: ${{ matrix.os }}
needs: wait
steps:
- uses: actions/checkout@v4
# needed for arm targets
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Update apt repositories (linux)
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get update
- name: Install GCC arm64 (linux)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Install GCC armhf (linux)
if: matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get install gcc-arm-linux-gnueabihf
- run: cargo build --target ${{ matrix.target }} --release
- run: npm ci
- name: vsce package
# use bash on windows
shell: bash
run: |
mkdir -p bundled dist
cp target/${{ matrix.target }}/release/typos-lsp* bundled/
npx vsce package -o dist/ --target ${{ matrix.code-target }}
- name: Archive
shell: bash
run: |
ver=${GITHUB_REF/refs\/*\//}
archive="typos-lsp-$ver-${{ matrix.target }}"
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7z a "dist/${archive}.zip" target/${{ matrix.target }}/release/typos-lsp.exe
else
tar czf "dist/${archive}.tar.gz" -C target/${{ matrix.target }}/release typos-lsp
fi
ls -al dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: dist
publish:
runs-on: ubuntu-latest
needs: dist
permissions:
contents: write
steps:
- uses: actions/checkout@v4
# download each artifact into its own self-named directory
- uses: actions/download-artifact@v4
with:
path: dist
- run: npm ci
- name: Inspect dist
run: |
ls -al dist/*
npx glob dist/**/*.vsix
- name: vsce publish
run: npx vsce publish --packagePath $(npx glob dist/**/*.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: ovsx publish
run: npx ovsx publish --packagePath $(npx glob dist/**/*.vsix)
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Upload to GH release
uses: softprops/action-gh-release@v1
with:
files: dist/**/*
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3