focus/.gitea/workflows/release.yaml

113 lines
2.9 KiB
YAML
Raw Permalink Normal View History

2024-01-13 22:47:31 +01:00
name: Build releases
run-name: ${{ gitea.actor }} is runs ci pipeline
on:
push:
tags:
- "v*"
jobs:
build-docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
strategy:
matrix:
include:
- context: ./backend
image: focus-backend
- context: ./frontend
dockerfile: ./frontend/Dockerfile
image: focus-frontend
- context: .
image: focu
env:
RUNNER_TOOL_CACHE: /toolcaches
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract tag
uses: olegtarasov/get-tag@v2.1.2
id: tagName
with:
tagRegex: "v(.*)"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."git.bhasher.com"]
http = true
insecure = true
- name: Login
uses: docker/login-action@v2
with:
registry: git.bhasher.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push ${{ matrix.image }}
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Dockerfile
push: true
platforms: |
linux/amd64
linux/arm64
tags: |
git.bhasher.com/bhasher/${{ matrix.image }}:latest
git.bhasher.com/bhasher/${{ matrix.image }}:${{ steps.tagName.outputs.tag }}
build-tauri:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract tag
uses: olegtarasov/get-tag@v2.1.2
id: tagName
with:
tagRegex: "v(.*)"
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: |
cd frontend
npm install
cd ..
- name: Build desktop app
run: |
cd frontend
npm run tauri build
cd ..
- name: Publish desktop app
uses: akkuman/gitea-release-action@v1
with:
name: Focus ${{ steps.tagName.outputs.tag }}
prerelease: true
files: |-
frontend/src-tauri/target/release/focus
frontend/src-tauri/target/release/bundle/deb/*.deb
frontend/src-tauri/target/release/bundle/appimage/*.AppImage