Skip to content

release

release #31

Workflow file for this run

name: release
on:
release:
types: [published]
workflow_dispatch:
jobs:
wait:
runs-on: ubuntu-latest
steps:
- name: Wait for build check to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-regexp: build.*
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-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: i686-pc-windows-msvc
code-target: win32-ia32
- 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-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64
name: dist (${{ matrix.target }})
runs-on: ${{ matrix.os }}
#needs: wait
steps:
- uses: actions/checkout@v3
# needed for arm targets
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
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: |
ref=${GITHUB_REF:-snapshot}
ver=${ref/refs\/tags\//}
archive="typos-lsp-$ver-${{ matrix.target }}"
mkdir -p bundled dist
cp target/${{ matrix.target }}/release/typos-lsp* bundled/
npx vsce package -o dist/ --target ${{ matrix.code-target }}
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7a "dist/${archive}.zip" bundled/*
else
tar czf "dist/${archive}.tar.gz" -C bundled .
fi
ls -al dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: dist
publish:
runs-on: ubuntu-latest
needs: dist
permissions:
contents: write
steps:
- uses: actions/checkout@v3
# download each artifact into its own self-named directory
- uses: actions/download-artifact@v3
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: Upload to GH release
# uses: softprops/action-gh-release@v1
# with:
# files: dist/**/*.vsix
- name: Setup tmate session
#if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3