mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
🎁 GitHub releases 🎁
This commit is contained in:
parent
875352b2b6
commit
5514ca3997
1 changed files with 98 additions and 13 deletions
111
.github/workflows/release.yaml
vendored
111
.github/workflows/release.yaml
vendored
|
@ -5,8 +5,8 @@ on:
|
||||||
- release
|
- release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rust:
|
build-server:
|
||||||
name: Rust
|
name: build-server
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -35,13 +35,12 @@ jobs:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
components: rustfmt, rust-src
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: build
|
command: build
|
||||||
args: --release --package ra_lsp_server --bin ra_lsp_server
|
args: --package ra_lsp_server --bin ra_lsp_server --release
|
||||||
|
|
||||||
- name: Strip symbols
|
- name: Strip symbols
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
@ -50,13 +49,17 @@ jobs:
|
||||||
- name: Create distribution dir
|
- name: Create distribution dir
|
||||||
run: mkdir ./dist
|
run: mkdir ./dist
|
||||||
|
|
||||||
- name: Copy binaries (unix)
|
- name: Copy binary
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: cp ./target/release/ra_lsp_server ./dist
|
run: cp ./target/release/ra_lsp_server ./dist/ra_lsp_server-linux
|
||||||
|
|
||||||
- name: Copy binaries (win)
|
- name: Copy binary
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: cp ./target/release/ra_lsp_server ./dist/ra_lsp_server-mac
|
||||||
|
|
||||||
|
- name: Copy binary
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: copy ./target/release/ra_lsp_server.exe ./dist
|
run: copy ./target/release/ra_lsp_server.exe ./dist/ra_lsp_server-windows.exe
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
|
@ -64,8 +67,8 @@ jobs:
|
||||||
name: server-${{ matrix.os }}
|
name: server-${{ matrix.os }}
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
type-script:
|
build-clients:
|
||||||
name: TypeScript
|
name: build-clients
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
@ -83,13 +86,95 @@ jobs:
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
|
|
||||||
- name: Copy vscode extension
|
- name: Copy vscode extension
|
||||||
run: mkdir -p ./dist/code && cp ./editors/code/*.vsix ./dist/code/
|
run: mkdir -p ./dist/code && cp ./editors/code/*.vsix ./dist/
|
||||||
|
|
||||||
- name: Copy emacs mode
|
- name: Copy emacs mode
|
||||||
run: cp -R ./editors/emacs ./dist/
|
run: cp ./editors/emacs/rust-analyzer.el ./dist/rust-analyzer.el
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: editor-plugins
|
name: editor-plugins
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
|
make-release:
|
||||||
|
name: make-release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: ['build-server', 'build-clients']
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: editor-plugins
|
||||||
|
path: dist
|
||||||
|
- uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: server-macos-latest
|
||||||
|
path: dist
|
||||||
|
- uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: server-ubuntu-latest
|
||||||
|
path: dist
|
||||||
|
- uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: server-windows-latest
|
||||||
|
path: dist
|
||||||
|
- run: ls -all ./dist
|
||||||
|
|
||||||
|
- run: echo "::set-env name=TAG::$(date --iso)"
|
||||||
|
- run: 'echo "TAG: $TAG"'
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.TAG }}
|
||||||
|
release_name: ${{ env.TAG }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/ra_lsp_server-linux
|
||||||
|
asset_name: ra_lsp_server-linux
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/ra_lsp_server-mac
|
||||||
|
asset_name: ra_lsp_server-mac
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/ra_lsp_server-windows.exe
|
||||||
|
asset_name: ra_lsp_server-windows.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/rust-analyzer-0.1.0.vsix
|
||||||
|
asset_name: rust-analyzer-0.1.0.vsix
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- uses: actions/upload-release-asset@v1.0.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/rust-analyzer.el
|
||||||
|
asset_name: rust-analyzer.el
|
||||||
|
asset_content_type: text/plain
|
||||||
|
|
Loading…
Reference in a new issue