file-tree/.github/workflows/release.yaml
damien ed8135da28
All checks were successful
Build / build (ubuntu-latest) (push) Successful in 20m1s
Eslint & Clippy / eslint_and_clippy (push) Successful in 31m56s
Update .github/workflows/release.yaml
2025-03-01 14:01:34 +00:00

90 lines
2.6 KiB
YAML

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_id: ${{steps.create_release.outputs.id}}
build:
needs: create_release
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] #, window-latest, macos-latest,
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Install Node.js v20 LTS
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install sharp dependencies for macOS
if: matrix.os == 'macos-latest'
run: |
brew install vips
- 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: Install zip utility on Windows
if: matrix.os == 'windows-latest'
run: choco install zip -y
- name: Build application
run: npm run tauri build
- name: Zip release bundle
run: |
zip -r release_${{ matrix.os }}.zip ./src-tauri/target/release/bundle/
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
with:
upload_url: http://192.168.1.147:3434/api/v1/repos/damien/file-tree/releases/${{ needs.create_release.outputs.upload_id }}/assets
asset_path: ./release_${{ matrix.os }}.zip
asset_name: file_tree_${{ github.event.inputs.version }}_${{ matrix.os }}.zip
asset_content_type: application/zip