Update AutoBuild.yml
This commit is contained in:
parent
8f93ffa7cc
commit
10903e8e00
|
@ -93,41 +93,35 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd openwrt
|
cd openwrt
|
||||||
source $GITHUB_WORKSPACE/$CUSTOM_SCRIPT && Diy-Part3
|
source $GITHUB_WORKSPACE/$CUSTOM_SCRIPT && Diy-Part3
|
||||||
|
echo "## $(date +"%Y%m%d")-AutoBuild" > update_log.txt
|
||||||
|
echo "Artifacts_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload Firmware to Artifacts
|
- name: Upload Firmware to Artifacts
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
|
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_Firmware
|
name: OpenWrt_Firmware_${{ env.Artifacts_DATE }}
|
||||||
path: openwrt/bin/Firmware
|
path: openwrt/bin/Firmware
|
||||||
|
|
||||||
- name: Upload Firmware directory to Artifacts
|
- name: Upload Firmware directory to Artifacts
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
if: env.UPLOAD_BIN_DIR == 'true' && !cancelled()
|
if: env.UPLOAD_BIN_DIR == 'true' && !cancelled()
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_bin
|
name: OpenWrt_bin_${{ env.Artifacts_DATE }}
|
||||||
path: openwrt/bin
|
path: openwrt/bin
|
||||||
|
|
||||||
- name: Generate Tag
|
|
||||||
id: tag
|
|
||||||
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
|
|
||||||
run: |
|
|
||||||
echo "$(date +"%Y%m%d")-AutoUpdate" > update_log.txt
|
|
||||||
echo "::set-env name=FIRMWARE::openwrt/bin/Firmware"
|
|
||||||
echo "::set-output name=status::success"
|
|
||||||
|
|
||||||
- name: Upload Firmware to Releases
|
- name: Upload Firmware to Releases
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: steps.tag.outputs.status == 'success' && !cancelled()
|
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: AutoUpdate
|
tag_name: AutoUpdate
|
||||||
body_path: update_log.txt
|
body_path: update_log.txt
|
||||||
files: ${{ env.FIRMWARE }}/*
|
files: openwrt/bin/Firmware/*
|
||||||
|
|
||||||
- name: Remove old Artifacts
|
- name: Remove old Artifacts
|
||||||
uses: c-hive/gha-remove-artifacts@v1
|
uses: c-hive/gha-remove-artifacts@v1
|
||||||
with:
|
with:
|
||||||
age: '1 month'
|
age: '1 day'
|
||||||
skip-recent: 3
|
skip-recent: 3
|
||||||
|
|
Loading…
Reference in New Issue