changed github actions workflow to install rustup with defaults accepted

This commit is contained in:
Vomitblood 2024-08-08 00:49:53 +08:00
parent 3e813bbe7e
commit fb2b7b0bf0
3 changed files with 73 additions and 21 deletions

View file

@ -1,4 +1,4 @@
name: Test Build Frontend name: Build
on: on:
push: push:
@ -15,30 +15,21 @@ jobs:
image: ubuntu:22.04 image: ubuntu:22.04
steps: steps:
- name: Install git - name: Update APT
run: apt update && apt install -y git run: apt update
- name: Install Git and dependencies for Tauri
run: apt install -y git libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Get Variables - name: Get Variables
run: | run: |
git config --global --add safe.directory /__w/stort/stort git config --global --add safe.directory /__w/stort/stort
echo "TAG_NAME=commit-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "TAG_NAME=commit-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Update packages - name: Install Mise
run: apt update && apt upgrade -y
- name: Install dependencies for Tauri
run: apt install -y libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
rustup update
- name: Install mise
run: | run: |
install -dm 755 /etc/apt/keyrings 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 wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
@ -46,16 +37,19 @@ jobs:
apt update apt update
apt install -y mise apt install -y mise
- name: Install mise tools - name: Install Mise Tools
run: | run: |
mise install mise install
mise settings set experimental true mise settings set experimental true
- name: Install bun packages - name: Install Bun Packages
run: mise exec bun --command 'bun install' run: mise exec bun --command 'bun install'
- name: Build Tauri - name: Build Tauri
run: mise exec bun --command 'bun run tauri build' run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
mise exec bun --command 'bun run tauri build'
- name: Create Release - name: Create Release
id: create_release id: create_release
@ -68,7 +62,7 @@ jobs:
draft: false draft: false
prerelease: false prerelease: false
- name: Upload build to release - name: Upload Build to Release
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

32
.github/workflows/testing.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: Testing
on:
push:
branches:
- "*"
permissions:
contents: write
jobs:
testing:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Debug shell
run: |
echo $0
echo $SHELL
- name: Debug Bash shell
run: |
echo $0
echo $SHELL
shell: bash
- name: Debug sh Shell
run: echo $0
echo $SHELL
shell: sh

26
build2.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/bash
IMAGE_NAME="ubuntu:22.04"
HOST_PROJECT_DIR="$PWD"
CONTAINER_PROJECT_DIR="/app"
HOST_OUTPUT_DIR="$PWD/src-tauri/target/release/bundle/appimage"
CONTAINER_OUTPUT_DIR="$CONTAINER_PROJECT_DIR/src-tauri/target/release/bundle/appimage"
USER_ID=$(id -u)
GROUP_ID=$(id -g)
docker pull $IMAGE_NAME
# run the docker image and remove on completion
docker run --rm -it \
-v "$HOST_PROJECT_DIR":$CONTAINER_PROJECT_DIR \
$IMAGE_NAME \
/bin/bash -c "
# update packages
apt update && apt install curl -y && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
echo $HOME && \
source "/root/.cargo/env" && \
cargo --version
"