Skip to content

Build

Build #86

Workflow file for this run

#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Build
run: |
REPO="${{ github.repository }}"
TAG=$(date +"%Y.%m.%d-%H%M")
echo "TAG=${TAG}" >> $GITHUB_ENV
python3 build.py --repo "${REPO}" --tag "${TAG}" --metadata
- name: Check and Push
if: success()
run: |
echo "Git push ..."
# git checkout main
git pull
status=$(git status -s | grep -E "fnpack.json" | awk '{printf " %s", $2}')
if [ -n "${status}" ]; then
git add ${status}
git commit -m "update $(date +%Y-%m-%d" "%H:%M:%S)"
git push -f
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: fn-apps
path: "*.fpk"
retention-days: 5
- name: Release
if: success() && !cancelled()
uses: softprops/action-gh-release@v2
with:
body_path: "apps-list.md"
tag_name: ${{ env.TAG }}
files: |
*.fpk