Tweak release workflow

This commit is contained in:
Aleksey Kladov 2020-01-11 21:48:30 +01:00
parent 7d4a62275d
commit 7e1a25f149

View file

@ -1,9 +1,8 @@
name: CI-Release name: CI-Release
on: on:
pull_request:
push: push:
branches: branches:
- master - release
jobs: jobs:
rust: rust:
@ -15,7 +14,6 @@ jobs:
env: env:
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
RUN_SLOW_TESTS: 1
RUSTUP_MAX_RETRIES: 10 RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10 CARGO_NET_RETRY: 10
steps: steps:
@ -39,47 +37,26 @@ jobs:
override: true override: true
components: rustfmt, rust-src components: rustfmt, rust-src
- name: Cache cargo registry - name: Build
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo target dir
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Compile and Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: build
args: --release --all-targets args: --release --package ra_lsp_server --bin ra_lsp_server
- name: Prepare cache - name: Strip symbols
run: cargo xtask pre-cache if: matrix.os == 'ubuntu-latest'
run: strip ./target/release/ra_lsp_server
- name: Prepare cache 2 - name: Create distribution dir
if: matrix.os == 'windows-latest'
run: Remove-Item ./target/release/xtask.exe
- name: Creat distribution dir
run: mkdir ./dist run: mkdir ./dist
- name: Copy binaries (non-win) - name: Copy binaries (unix)
if: matrix.os != 'windows-latest' if: matrix.os != 'windows-latest'
run: cp ./target/release/ra_lsp_server ./dist run: cp ./target/release/ra_lsp_server ./dist
- name: Copy binaries (win) - name: Copy binaries (win)
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: copy ./target/release/ra_lsp_server.* ./dist run: copy ./target/release/ra_lsp_server.exe ./dist
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
@ -90,9 +67,6 @@ jobs:
type-script: type-script:
name: TypeScript name: TypeScript
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
CXX: g++-4.9
CC: gcc-4.9
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v1
@ -104,14 +78,12 @@ jobs:
- run: npm ci - run: npm ci
working-directory: ./editors/code working-directory: ./editors/code
- run: npm run package --scripts-prepend-node-path - run: npm run package --scripts-prepend-node-path
working-directory: ./editors/code working-directory: ./editors/code
- name: Create distribution directory
run: mkdir ./dist
- name: Copy vscode extension - name: Copy vscode extension
run: mkdir ./dist/code && cp ./editors/code/*.vsix ./dist/code/ run: mkdir -p ./dist/code && cp ./editors/code/*.vsix ./dist/code/
- name: Copy emacs mode - name: Copy emacs mode
run: cp -R ./editors/emacs ./dist/ run: cp -R ./editors/emacs ./dist/
@ -119,5 +91,5 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: editors name: editor-plugins
path: ./dist path: ./dist