Skip to content

Commit

Permalink
fix: fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Jun 13, 2024
1 parent b50daa6 commit 98eef84
Showing 1 changed file with 38 additions and 88 deletions.
126 changes: 38 additions & 88 deletions .github/workflows/release.yml
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 }}

0 comments on commit 98eef84

Please sign in to comment.