Create release.yaml

This commit is contained in:
Damien 2025-02-22 02:58:40 -05:00 committed by GitHub
parent 86e85e70f0
commit 072cb029c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

90
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,90 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
jobs:
build:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository code
uses: actions/checkout@v3
# Cache Rust
- uses: actions/cache@v3
with:
path: ./src-tauri/target
key: ${{matrix.os}}-${{ hashFiles('./src-tauri/Cargo.lock') }}
# Cache Rust
- uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{matrix.os}}-${{ hashFiles('./src-tauri/Cargo.lock') }}
# Cache Node
- uses: actions/cache@v3
with:
path: ./node_modules
key: ${{matrix.os}}-${{ hashFiles('./package-lock.json') }}
# Cache Next.js
- uses: actions/cache@v3
with:
path: ./src-next/.next
key: ${{matrix.os}}
- name: Install Node.js v20 LTS
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install Rust with Clippy
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install Tauri dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install --reinstall ca-certificates
sudo update-ca-certificates -f
sudo apt-get install javascriptcoregtk-4.1 libsoup-3.0 webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev -y
- name: Install node dependencies
run: npm install
- name: Build application
run: npm run tauri build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: src-tauri/target/release/bundle/**
asset_name: my_app_${{ github.event.inputs.version }}
asset_content_type: application/zip