Nginx Builder #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nginx Builder | |
on: | |
push: | |
# 修改为监控所有分支推送(移除分支过滤) | |
# 添加nginx子模块路径监控(按实际路径调整) | |
paths: | |
- "**" | |
- "nginx/**" | |
schedule: | |
# 每天UTC时间0点执行(北京时间8点) | |
- cron: '0 0 */3 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检查代码 | |
uses: actions/checkout@v4 | |
- name: 安装工具 | |
run: | | |
sudo apt-get install -y curl 7zip tar git gcc mingw-w64 make perl | |
- name: 构建 | |
run: | | |
chmod +x nginx-builder.sh | |
sh ./nginx-builder.sh windows i686-w64-mingw32-gcc x86 | |
sh ./nginx-builder.sh windows x86_64-w64-mingw32-gcc x86_64 | |
- name: 校验 | |
run: | | |
for file in *.7z; do | |
echo "${file}:" >> hash.txt | |
md5sum "$file" | awk '{print "MD5: "$1}' >> hash.txt | |
sha1sum "$file" | awk '{print "SHA1: "$1}' >> hash.txt | |
sha256sum "$file" | awk '{print "SHA256: "$1}' >> hash.txt | |
echo "" >> hash.txt | |
done | |
- name: 设置构建时间 | |
id: set-time | |
run: | | |
echo "DATE_STR=$(date '+%Y.%m.%d %H:%M:%S')" >> $GITHUB_OUTPUT | |
echo "TAG_STR=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: 上传github release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
./*.7z | |
./hash.txt | |
./*.tar.gz | |
name: "构建时间/Build Time: ${{ steps.set-time.outputs.DATE_STR }}" | |
tag_name: ${{ steps.set-time.outputs.TAG_STR }} |