Skip to content

v0.29.713_20240419_syv3.0.10 #45

v0.29.713_20240419_syv3.0.10

v0.29.713_20240419_syv3.0.10 #45

Workflow file for this run

name: afterCI change release
on:
# workflow_run:
# workflows: ["Sillot CI/CD"]
# types:
# - completed
workflow_dispatch:
release:
types: [released]
# https://docs.github.com/zh/actions/using-workflows/events-that-trigger-workflows#release
jobs:
test:
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 20
- name: Get Latest Release Assets
id: latest_release
uses: actions/github-script@v6
with:
result-encoding: string
retries: 3
debug: true
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { execSync } = require('child_process');
const { data } = await github.rest.repos.getLatestRelease({owner: 'Hi-Windom',repo: 'Sillot'});
// const d = JSON.stringify(data);
// console.log(d)
data.assets.forEach(async (e) => { console.log(e.browser_download_url); execSync(`curl -LO ${e.browser_download_url}`); })
return data.upload_url
continue-on-error: false
- name: Generate Hash for Assets
id: generate_hash
# 使用了 awk 的内置函数 toupper() 来将哈希值转换为大写,同时使用空格作为字段分隔符。awk 会将每一行的第一个字段(哈希值)转换为大写,并且保留第二个字段(文件名)
run: |
ls
find . -type f -name 'Sillot-*' -exec md5sum {} + | awk '{print toupper($1), $2}' > Assets_MD5_Sum.txt
find . -type f -name 'Sillot-*' -exec sha256sum {} + | awk '{print toupper($1), $2}' > Assets_SHA256_Sum.txt
continue-on-error: false
- name: Upload Assets_MD5_Sum.txt File to Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.latest_release.outputs.result }}
asset_path: ./Assets_MD5_Sum.txt
asset_name: Assets_MD5_Sum.txt
asset_content_type: text/plain
- name: Upload Assets_SHA256_Sum.txt File to Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.latest_release.outputs.result }}
asset_path: ./Assets_SHA256_Sum.txt
asset_name: Assets_SHA256_Sum.txt
asset_content_type: text/plain