mirror of
https://github.com/zhigang1992/Hackintosh-EFI-MSI-Z490i-Unify.git
synced 2026-01-12 22:47:47 +08:00
feat auto update
This commit is contained in:
16
.github/workflows/update.yml
vendored
16
.github/workflows/update.yml
vendored
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2022 Ing
|
||||
# Copyright (C) 2022 Ing <https://github.com/wjz304>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
@@ -17,6 +17,7 @@ env:
|
||||
HAS_OPENSSL_BUILD: 1
|
||||
HAS_OPENSSL_W32BUILD: 0
|
||||
ACID32: 1
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
@@ -33,6 +34,12 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@main
|
||||
|
||||
- name: Initialization environment
|
||||
run : |
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
sudo systemsetup -settimezone "Asia/Shanghai"
|
||||
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
python3 -m pip install -U pip
|
||||
@@ -43,7 +50,7 @@ jobs:
|
||||
|
||||
- name: Check for changes
|
||||
run: |
|
||||
if [ -n "$(git status -s | grep -v -w VERTIME)" ];then
|
||||
if [ -n "$(git status -s | grep -v -w timestamp)" ];then
|
||||
echo "ischanges=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "ischanges=false" >> $GITHUB_ENV
|
||||
@@ -62,6 +69,7 @@ jobs:
|
||||
run: |
|
||||
echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")"
|
||||
echo "::set-output name=status::success"
|
||||
echo "::set-output name=repository_name::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')"
|
||||
|
||||
- name: Zip EFI
|
||||
if: env.ischanges == 'true'
|
||||
@@ -69,7 +77,7 @@ jobs:
|
||||
with:
|
||||
files: EFI README.md
|
||||
recursive: false
|
||||
dest: Hackintosh-EFI-MSI-Z490i-Unify-${{ steps.tag.outputs.release_tag }}.zip
|
||||
dest: ${{ steps.tag.outputs.repository_name }}-${{ steps.tag.outputs.release_tag }}.zip
|
||||
|
||||
- name: Upload firmware to release
|
||||
if: env.ischanges == 'true'
|
||||
@@ -81,7 +89,7 @@ jobs:
|
||||
files: Hackintosh*.zip
|
||||
|
||||
- name: Delete workflow runs
|
||||
uses: GitRML/delete-workflow-runs@main
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 3
|
||||
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2022 Ing <https://github.com/wjz304>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,4 +1,9 @@
|
||||
|
||||
#
|
||||
# Copyright (C) 2022 Ing <https://github.com/wjz304>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
import os, sys, json, shutil, datetime, zipfile
|
||||
import urllib3
|
||||
@@ -10,7 +15,7 @@ PM = urllib3.PoolManager()
|
||||
date_curr = datetime.datetime.now(tz=datetime.timezone.utc).isoformat()
|
||||
date_last = ''
|
||||
|
||||
date_last_file = 'VERTIME'
|
||||
date_last_file = 'timestamp'
|
||||
try:
|
||||
with open(date_last_file,'r') as f:
|
||||
date_last = f.read()
|
||||
|
||||
Reference in New Issue
Block a user