🎁 GitHub releases 🎁

This commit is contained in:
Aleksey Kladov 2020-01-13 12:44:22 +01:00
parent 875352b2b6
commit 5514ca3997

View file

@ -5,8 +5,8 @@ on:
- release
jobs:
rust:
name: Rust
build-server:
name: build-server
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -35,13 +35,12 @@ jobs:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src
- name: Build
uses: actions-rs/cargo@v1
with:
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
if: matrix.os == 'ubuntu-latest'
@ -50,13 +49,17 @@ jobs:
- name: Create distribution dir
run: mkdir ./dist
- name: Copy binaries (unix)
if: matrix.os != 'windows-latest'
run: cp ./target/release/ra_lsp_server ./dist
- name: Copy binary
if: matrix.os == 'ubuntu-latest'
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'
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
uses: actions/upload-artifact@v1
@ -64,8 +67,8 @@ jobs:
name: server-${{ matrix.os }}
path: ./dist
type-script:
name: TypeScript
build-clients:
name: build-clients
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@ -83,13 +86,95 @@ jobs:
working-directory: ./editors/code
- 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
run: cp -R ./editors/emacs ./dist/
run: cp ./editors/emacs/rust-analyzer.el ./dist/rust-analyzer.el
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: editor-plugins
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