fix project name change error #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release (AMXXPawn) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build ${{ matrix.target }} | |
if: "contains(github.event.head_commit.message, 'trigger-ci: amxxpawn')" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
program: cargo | |
platform: win32 | |
arch: x64 | |
archive: sourcepawn-studio-x86_64-windows.zip | |
- os: windows-latest | |
target: i686-pc-windows-msvc | |
program: cargo | |
platform: win32 | |
arch: ia32 | |
archive: sourcepawn-studio-i686-windows.zip | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
program: cargo | |
platform: win32 | |
arch: arm64 | |
archive: sourcepawn-studio-aarch64-windows.zip | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
program: cargo | |
platform: darwin | |
arch: x64 | |
archive: sourcepawn-studio-x86_64-macos.zip | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
program: cargo | |
platform: darwin | |
arch: arm64 | |
archive: sourcepawn-studio-aarch64-macos.zip | |
- os: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
program: cargo | |
platform: linux | |
arch: x64 | |
archive: sourcepawn-studio-x86_64-linux.zip | |
- os: ubuntu-20.04 | |
target: aarch64-unknown-linux-gnu | |
program: cross | |
platform: linux | |
arch: arm64 | |
archive: sourcepawn-studio-aarch64-linux.zip | |
- os: ubuntu-20.04 | |
target: armv7-unknown-linux-gnueabihf | |
program: cross | |
platform: linux | |
arch: armhf | |
archive: sourcepawn-studio-armv7hf-linux.zip | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Setup Sentry CLI | |
uses: mathieu-bour/setup-sentry-cli@v1 | |
with: | |
token: ${{ SECRETS.SENTRY_AUTH_TOKEN }} | |
organization: ${{ secrets.SENTRY_ORG }} | |
project: sourcepawn-lsp | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install cross | |
if: ${{ matrix.program == 'cross' }} | |
run: cargo install cross | |
- name: Install libssl-dev | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: sudo apt-get install pkg-config libssl-dev | |
- 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-studio.exe {1}', matrix.target, matrix.archive) }} | |
- name: Compress (macOS) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn-studio', matrix.target, matrix.archive) }} | |
- name: Compress (Linux) | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn-studio', matrix.target, matrix.archive) }} | |
- name: Upload debug symbols | |
run: sentry-cli upload-dif --wait target/${{ matrix.target }}/release/ | |
- shell: pwsh | |
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV | |
- name: Install npm dependencies | |
working-directory: ./editors/code-amxxpawn | |
run: npm install | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bundle sourcepawn-studio (Windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
shell: pwsh | |
run: | | |
mkdir -p editors/code-amxxpawn/languageServer | |
cp target/${{ matrix.target }}/release/sourcepawn-studio.exe editors/code-amxxpawn/languageServer/ | |
- name: Bundle sourcepawn-studio | |
if: ${{ !contains(matrix.os, 'windows') }} | |
shell: pwsh | |
run: | | |
mkdir -p editors/code-amxxpawn/languageServer | |
cp target/${{ matrix.target }}/release/sourcepawn-studio editors/code-amxxpawn/languageServer/ | |
- name: Package VSCode extension | |
working-directory: ./editors/code-amxxpawn | |
run: npx vsce package --target ${{ env.target }} | |
- name: Upload sourcepawn-studio binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: ${{ matrix.archive }} | |
- name: Upload VSIX package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.target }} | |
path: "editors/code-amxxpawn/*.vsix" | |
marketplace: | |
name: Publish to VSCode marketplace | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Publish VSIX package (Release) | |
if: ${{ !github.event.release.prerelease }} | |
run: npx vsce publish --packagePath $(find . -iname *.vsix) | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_TOKEN }} | |
- name: Publish VSIX package (Prerelease) | |
if: ${{ github.event.release.prerelease }} | |
run: npx vsce publish --packagePath $(find . -iname *.vsix) --pre-release | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_TOKEN }} | |
ovsx: | |
name: Publish to Open VSX | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Publish VSIX package (Release) | |
if: ${{ !github.event.release.prerelease }} | |
run: npx ovsx publish -p $OVSX_TOKEN --packagePath $(find . -iname *.vsix) | |
env: | |
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }} | |
- name: Publish VSIX package (Prerelease) | |
if: ${{ github.event.release.prerelease }} | |
run: npx ovsx publish -p $OVSX_TOKEN --packagePath $(find . -iname *.vsix) --pre-release | |
env: | |
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }} |