Merge pull request #2 from Trivernis/gh-actions

Improve release workflow
pull/4/head
Julius Riegel 3 years ago committed by GitHub
commit 18014d6271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,17 +3,141 @@ name: Create pre-release
on: on:
push: push:
branches: branches:
- "master" - main
jobs: jobs:
pre-release: create-release-draft:
name: Pre Release name: pre-release
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps: steps:
- uses: marvinpinto/action-automatic-releases@latest - uses: actions/checkout@v2
if: ${{ !env.ACT }}
- id: create_release
uses: marvinpinto/action-automatic-releases@latest
if: ${{ !env.ACT }}
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest automatic_release_tag: latest
prerelease: true draft: true
title: Latest Pre-Release title: Latest Pre-Release
files: | files: |
LICENSE LICENSE
build-daemon:
needs: create-release-draft
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: mediarepo-daemon
steps:
- uses: actions/checkout@v2
if: ${{ !env.ACT }}
- name: Cache build data
if: ${{ !env.ACT }}
uses: actions/cache@v2
with:
path: |
target
~/.cargo/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build Daemon
run: cargo build --release --no-default-features
- uses: papeloto/action-zip@v1
with:
files: target/release/mediarepo-daemon target/release/mediarepo-daemon.exe
dest: mediarepo-daemon-${{ runner.os }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }}
asset_path: ./mediarepo-daemon-${{ runner.os }}.zip
asset_name: mediarepo-daemon-${{ runner.os }}.zip
asset_content_type: application/zip
build-ui:
needs: create-release-draft
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: mediarepo-ui
steps:
- uses: actions/checkout@v2
if: ${{ !env.ACT }}
- name: Cache Dependencies
if: ${{ !env.ACT }}
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
node_modules
src-tauri/target
/home/runner/.cargo
~/.cargo
key: ${{ runner.os }}-release-dependencies-${{ hashFiles('src-tauri/Cargo.lock') }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-release-dependencies-
${{ runner.os }}-dependencies-
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Tauri
run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Install OS-specific dependencies
uses: knicknic/os-specific-run@v1.0.3
with:
linux: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y
- name: Build project
run: cargo tauri build
- uses: papeloto/action-zip@v1
with:
files: src-tauri/target/release/bundle src-tauri/target/release/mediarepo-ui src-tauri/target/release/mediarepo-ui.exe
dest: mediarepo-ui-${{ runner.os }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release-draft.outputs.release_upload_url }}
asset_path: ./mediarepo-ui-${{ runner.os }}.zip
asset_name: mediarepo-ui-${{ runner.os }}.zip
asset_content_type: application/zip

3
.gitignore vendored

@ -27,3 +27,6 @@ mediarepo-ui/.idea
# System Files # System Files
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# other
*.zip
Loading…
Cancel
Save