From 98eef8446c9f0415b98c393ff885ac01d25134bf Mon Sep 17 00:00:00 2001 From: frectonz Date: Thu, 13 Jun 2024 09:12:49 +0300 Subject: [PATCH] fix: fix release action --- .github/workflows/release.yml | 126 ++++++++++------------------------ 1 file changed, 38 insertions(+), 88 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 454e128..3d9ab5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }}