stort/.github/workflows/build-validation.yml

84 lines
2.6 KiB
YAML
Raw Normal View History

2024-08-07 15:23:09 +08:00
name: Test Build Frontend
on:
push:
branches:
- "*"
2024-08-07 17:06:59 +08:00
permissions:
contents: write
2024-08-07 15:23:09 +08:00
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
2024-08-07 17:35:51 +08:00
- name: Install git
run: apt update && apt install -y git
2024-08-07 15:23:09 +08:00
- name: Checkout Repository
2024-08-07 17:39:19 +08:00
uses: actions/checkout@v2
2024-08-07 17:26:48 +08:00
2024-08-07 16:27:53 +08:00
- name: Get Variables
2024-08-07 17:39:19 +08:00
run: |
echo "TAG_NAME=commit-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
ls -la
2024-08-07 16:27:53 +08:00
2024-08-07 17:25:59 +08:00
# - name: Update packages
# run: apt update && apt upgrade -y
2024-08-07 15:23:09 +08:00
2024-08-07 17:25:59 +08:00
# - name: Install dependencies for Tauri
# run: apt install -y cargo libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
2024-08-07 15:23:09 +08:00
2024-08-07 17:25:59 +08:00
# - name: Install mise
# run: |
# install -dm 755 /etc/apt/keyrings
# wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
# echo 'deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main' | tee /etc/apt/sources.list.d/mise.list
# apt update
# apt install -y mise
2024-08-07 15:23:09 +08:00
2024-08-07 17:25:59 +08:00
# - name: Install mise tools
# run: |
# mise install
# mise settings set experimental true
2024-08-07 15:36:05 +08:00
2024-08-07 17:25:59 +08:00
# - name: Install bun packages
# run: mise exec bun --command 'bun install'
2024-08-07 15:52:13 +08:00
2024-08-07 17:25:59 +08:00
# - name: Build Tauri
# run: mise exec bun --command 'bun run tauri build'
2024-08-07 16:12:20 +08:00
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2024-08-07 17:37:36 +08:00
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.TAG_NAME }}
2024-08-07 16:12:20 +08:00
draft: false
prerelease: false
2024-08-07 17:25:59 +08:00
# - name: Upload whatsip artifact to release (Windows)
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./src-tauri/target/release/bundle/appimage/*.AppImage
# asset_name: stort-appimage.zip
# asset_content_type: application/octet-stream
- name: Upload build to release
2024-08-07 16:12:20 +08:00
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2024-08-07 17:25:59 +08:00
asset_path: ./public/images/background.png
asset_name: background.zip
2024-08-07 16:12:20 +08:00
asset_content_type: application/octet-stream