Skip to content

Merge pull request #5 from arifintahu/fix/security #1

Merge pull request #5 from arifintahu/fix/security

Merge pull request #5 from arifintahu/fix/security #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary_name: astral
os_suffix: linux-amd64
extension: ""
- os: windows-latest
target: x86_64-pc-windows-msvc
binary_name: astral.exe
os_suffix: windows-amd64
extension: .exe
- os: macos-14
target: aarch64-apple-darwin
binary_name: astral
os_suffix: macos-arm64
extension: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Frontend Dependencies
working-directory: ./web
run: npm ci
- name: Build Frontend
working-directory: ./web
run: npm run build
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build Backend
run: cargo build --release --target ${{ matrix.target }}
- name: Rename Binary
shell: bash
run: |
mv target/${{ matrix.target }}/release/${{ matrix.binary_name }} astral-${{ github.ref_name }}-${{ matrix.os_suffix }}${{ matrix.extension }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: astral-${{ github.ref_name }}-${{ matrix.os_suffix }}${{ matrix.extension }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}