Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yaya2007 committed Jun 7, 2023
1 parent 63c6631 commit c3fe5e4
Showing 1 changed file with 18 additions and 43 deletions.
61 changes: 18 additions & 43 deletions .github/workflows/release.yml
@@ -1,59 +1,35 @@
name: grub4dos-build

on:
push:
branches: [ "master","efi","0.4.6a" ]
pull_request:
types: [ opened , synchronize ]
on:
push:
branches:
- 0.4.6a

jobs:
build-pr:
if: ${{ github.event_name == 'pull_request' }}
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- uses: chenall/grub4dos-build@main
- name: 上传文件到1 transfer.sh
run: |
echo transfer_url=`curl -H "Max-Downloads: 100" -H "Max-Days: 5" --upload-file ./$GRUB4DOS_BIN https://transfer.sh` >> $GITHUB_ENV
- name: 发送本次 pr 的编译结果
env:
URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name:
uses: actions/checkout@v3
- name: 初始化
run: |
curl -X POST $URL -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" --data "{ \"body\": \"$transfer_url\" }"
build-push:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-22.04
environment:
name: PAGES
env:
COMMIT_RANGE: "${{ github.event.before || github.event.pull_request.base.sha }}...${{ github.sha }}"
steps:
- name: 安装依赖项并进行环境变量配置
run: sudo apt -y install p7zip-full
sudo apt update
sudo apt -y install gcc gcc-multilib nasm p7zip-full autoconf automake make patch binutils-dev liblzma-dev gcc-mingw-w64-i686
- name: 下载源码
uses: actions/checkout@v2
with:
fetch-depth: 10
- name: 下载 ipxe 源码
if: ${{ contains(github.ref, '0.4.6') }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ipxe/ipxe
path: ipxe
- name: 调用专用编译环境进行编译
uses: chenall/grub4dos-build@main
repository: chenall/grub4dos
ref: efi
- name: 编译
run: |
make -j -C /home/runner/work/grub4dos/grub4dos
- name: 发布到 github
if: ${{ github.event_name == 'push' }}
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.GRUB4DOS_VER }}"
automatic_release_tag: "GRUB4DOS_0.4.6a"
prerelease: false
title: "${{ env.GRUB4DOS_BIN }}"
title: "GRUB4DOS_0.4.6a"
files: |
*.7z
*.zip
Expand All @@ -78,4 +54,3 @@ jobs:
git add source/_posts/downloads/*.md
git commit -m "`date -u +%Y-%m-%d` $GRUB4DOS_VER build from ${GITHUB_SHA:0:8} "
git push

0 comments on commit c3fe5e4

Please sign in to comment.