-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,45 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
name: Build and Release | ||
release: | ||
name: release ${{ matrix.target }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-pc-windows-gnu | ||
archive: zip | ||
- target: x86_64-unknown-linux-musl | ||
archive: zip | ||
- target: x86_64-apple-darwin | ||
archive: zip | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install npm dependencies | ||
run: | | ||
cd ui | ||
npm install | ||
- name: Build npm project | ||
run: | | ||
cd ui | ||
npm run build | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Build for Linux | ||
id: build-linux | ||
uses: rust-build/rust-build.action@v1 | ||
with: | ||
target: x86_64-unknown-linux-gnu | ||
|
||
- name: Build for Windows | ||
id: build-windows | ||
uses: rust-build/rust-build.action@v1 | ||
with: | ||
target: x86_64-pc-windows-msvc | ||
|
||
- name: Build for macOS | ||
id: build-macos | ||
uses: rust-build/rust-build.action@v1 | ||
with: | ||
target: x86_64-apple-darwin | ||
|
||
- name: Upload Linux artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-studio-linux | ||
path: target/x86_64-unknown-linux-gnu/release/sqlite-studio | ||
|
||
- name: Upload Windows artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-studio-windows | ||
path: target/x86_64-pc-windows-msvc/release/sqlite-studio.exe | ||
|
||
- name: Upload macOS artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sqlite-studio-macos | ||
path: target/x86_64-apple-darwin/release/sqlite-studio | ||
|
||
- name: Upload Release Assets - Linux | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: target/x86_64-unknown-linux-gnu/release/sqlite-studio | ||
asset_name: sqlite-studio-linux | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - Windows | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: target/x86_64-pc-windows-msvc/release/sqlite-studio.exe | ||
asset_name: sqlite-studio-windows.exe | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - macOS | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: target/x86_64-apple-darwin/release/sqlite-studio | ||
asset_name: sqlite-studio-macos | ||
asset_content_type: application/octet-stream | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install UI dependencies | ||
run: | | ||
cd ui | ||
npm install | ||
- name: Build UI | ||
run: | | ||
cd ui | ||
npm run build | ||
- name: Compile and release | ||
uses: actions/checkout@master | ||
uses: rust-build/rust-build.action@v1.4.5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
RUSTTARGET: ${{ matrix.target }} | ||
ARCHIVE_TYPES: ${{ matrix.archive }} |