Skip to content

Build

Build #10

Workflow file for this run

name: Build
on:
create:
tags:
- "v*.*.*"
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout project
id: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache src
id: cache-src
uses: actions/upload-artifact@v2
with:
name: repo
path: ./*
build:
needs: setup
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: repo
path: ./
- name: Compile
run: |
cargo build --release
cp -rf ./target/release/font_helper ./res/fonthelper
cd ./res
tar cJf ../fonthelper.tar.xz ./{*.service,fonthelper*,updater.sh}
- name: Cache artifacts
id: cache-artifacts
uses: actions/upload-artifact@v2
with:
name: main
path: ./fonthelper.tar.xz
release:
name: Upload assets
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: main
path: ./
- name: Extract version from tag name
id: version
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return context.payload.ref.replace(/\/refs\/tags\//, '');
- name: Upload release assets
id: release
uses: ChugunovRoman/action-gh-release@master
if: startsWith(github.ref, 'refs/tags/')
with:
name: Font Helper ${{ steps.version.outputs.release }}
files: ./fonthelper.tar.xz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}