Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Jan 31, 2023
1 parent 9129166 commit f2b6415
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 22 deletions.
74 changes: 53 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,98 @@ on:
types: [created]

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
program: cargo
archive: zip
archive: sourcepawn_lsp-x86_64-windows.zip

- os: windows-latest
target: i686-pc-windows-msvc
program: cargo
archive: zip
archive: sourcepawn_lsp-i686-windows.zip

- os: windows-latest
target: aarch64-pc-windows-msvc
program: cargo
archive: zip
archive: sourcepawn_lsp-aarch64-windows.zip

- os: macos-latest
target: x86_64-apple-darwin
program: cargo
archive: zip
archive: sourcepawn_lsp-x86_64-macos.zip

- os: macos-latest
target: aarch64-apple-darwin
program: cargo
archive: zip
archive: sourcepawn_lsp-aarch64-macos.zip

- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
program: cargo
archive: zip
archive: sourcepawn_lsp-x86_64-linux.zip

- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
program: cross
archive: zip
archive: sourcepawn_lsp-aarch64-linux.zip

- os: ubuntu-20.04
target: armv7-unknown-linux-gnueabihf
program: cross
archive: zip
archive: sourcepawn_lsp-armv7hf-linux.zip

- os: ubuntu-20.04
target: x86_64-unknown-linux-musl
program: cargo
archive: zip
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: ${{ matrix.program == 'cross' }}
run: cargo install cross
- name: Compile
run: ${{ matrix.program }} build --target ${{ matrix.target }} --all-features --release --locked
- name: Compress (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: ${{ format('Compress-Archive target/{0}/release/sourcepawn_lsp.exe {1}', matrix.target, matrix.archive) }}
- name: Compress (macOS)
if: ${{ contains(matrix.os, 'macos') }}
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn_lsp', matrix.target, matrix.archive) }}
- name: Compress (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn_lsp', matrix.target, matrix.archive) }}
- name: Upload binary archive
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ matrix.archive }}

github:
name: Publish releases
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/[email protected]
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Publish binaries
run: |
gh release upload ${{ github.ref_name }} $(find . -iname sourcepawn_lsp*.zip)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}

edit-release:
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Add changelog
id: changelog
uses: mindsers/[email protected]
Expand All @@ -79,6 +110,7 @@ jobs:

cargo:
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
steps:
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version = "0.4.0"
edition = "2021"
description = "Language Server implention for the SourcePawn programming language."
license = "GPL-3.0"
license-file = "LICENSE"

[[bin]]
name = "sourcepawn_lsp"
Expand Down

0 comments on commit f2b6415

Please sign in to comment.