Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish binaries and VS Code on GitHub release #1

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- run: cargo test

vscode:
build:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -42,8 +42,12 @@ jobs:
- uses: actions/checkout@v4
- run: ${{ matrix.install-script }}
- run: rustup target add ${{ matrix.rust-target }}
- run: npm ci
- run: cargo build --release --target ${{ matrix.rust-target }}
- uses: actions/upload-artifact@v4
with:
name: adroit-${{ matrix.target }}
path: target/${{ matrix.target }}/release/adroit${{ matrix.ext }}
- run: npm ci
- run: mkdir packages/adroit-vscode/bin
- run: cp target/${{ matrix.rust-target }}/release/adroit${{ matrix.ext }} packages/adroit-vscode/bin/adroit${{ matrix.ext }}
- run: npm run --workspace=adroit-vscode build -- --target ${{ matrix.vscode-platform }}
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release
on:
release:
types:
- created

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- vscode-platform: win32-x64
rust-target: x86_64-pc-windows-gnu
github-os: ubuntu-22.04
ext: ".exe"
install-script: sudo apt-get install -y mingw-w64
- vscode-platform: linux-x64
rust-target: x86_64-unknown-linux-musl
github-os: ubuntu-22.04
ext: ""
install-script: ""
- vscode-platform: darwin-x64
rust-target: x86_64-apple-darwin
github-os: macos-13
ext: ""
install-script: ""
- vscode-platform: darwin-arm64
rust-target: aarch64-apple-darwin
github-os: macos-14
ext: ""
install-script: ""
runs-on: ${{ matrix.github-os }}
steps:
- uses: actions/checkout@v4
- run: ${{ matrix.install-script }}
- run: rustup target add ${{ matrix.rust-target }}
- run: cargo build --release --target ${{ matrix.rust-target }}
- uses: softprops/action-gh-release@v2
with:
files: target/${{ matrix.rust-target }}/release/adroit${{ matrix.ext }}
- run: npm ci
- run: mkdir packages/adroit-vscode/bin
- run: cp target/${{ matrix.rust-target }}/release/adroit${{ matrix.ext }} packages/adroit-vscode/bin/adroit${{ matrix.ext }}
- run: npm run --workspace=adroit-vscode build -- --target ${{ matrix.vscode-platform }}
- uses: actions/upload-artifact@v4
with:
name: adroit-vscode-${{ matrix.vscode-platform }}
path: packages/adroit-vscode/adroit-vscode-*.vsix

vscode:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: adroit-vscode-win32-x64
path: vsix
- uses: actions/download-artifact@v4
with:
name: adroit-vscode-linux-x64
path: vsix
- uses: actions/download-artifact@v4
with:
name: adroit-vscode-darwin-x64
path: vsix
- uses: actions/download-artifact@v4
with:
name: adroit-vscode-darwin-arm64
path: vsix
- run: npm ci
- run: npx vsce publish --packagePath vsix/*
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/packages/adroit-vscode/bin/
/packages/adroit-vscode/dist/
/target/
/vsix/
node_modules/
Loading