Skip to content

Build & create release #2

Build & create release

Build & create release #2

Workflow file for this run

name: Build & create release
on:
workflow_dispatch:
inputs:
jobs:
#########
# BUILD #
#########
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
# Tasks
- run: npm install
- run: npx just build-prod
# Upload artifacts
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
##################
# CREATE RELEASE #
##################
create-release:
needs: build
runs-on: ubuntu-latest
outputs:
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
TAG_NAME: ${{ steps.package-version.outputs.current-version }}
steps:
- uses: actions/checkout@v4
- run: mkdir compressed
# Download artifacts
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
# Create zip
- uses: montudor/action-zip@v1
with:
args: zip -qq -r ./compressed/diffuse-web.zip ./dist
# Create tar.gz
- uses: master-atul/[email protected]
with:
command: c
cwd: .
files: ./dist
outPath: compressed/diffuse-web.tar.gz
# Get Diffuse's version number
- id: package-version
uses: martinbeentjes/[email protected]
# Create release
- uses: softprops/action-gh-release@v1
id: create_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ steps.package-version.outputs.current-version }}"
name: "v${{ steps.package-version.outputs.current-version }}"
body: "See the assets to download this version and install."
draft: true
files: |
compressed/diffuse-web.zip
compressed/diffuse-web.tar.gz
#########
# TAURI #
#########
tauri:
needs: create-release
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-14-large, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
# OS
- name: install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev
# Rust
- uses: moonrepo/setup-rust@v1
# Download artifacts
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
# Make a build
- run: npx tauri -- build
# Upload artifacts
- uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ needs.create-release.outputs.TAG_NAME }}"
draft: true
files: |
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/dmg/*.dmg
src-tauri/target/release/bundle/macos/*.app
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe
src-tauri/target/release/bundle/rpm/*.rpm