-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (52 loc) · 1.97 KB
/
Auto Release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Push Release
on:
push:
branches:
- 'master'
env:
BUILD_OUTPUT: 'Y7000P-Memory-overclocking'
jobs:
Push-Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '5'
- name: Manage Version
run: |
git fetch --prune --unshallow --tags
GIT_SHA="$(git rev-parse --short HEAD)"
CUR_TAG="$(git tag -l | grep 'alpha\|beta' | tail -1)"
echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV
echo "OPENCORE_VER=${CUR_TAG:1:3}" >> $GITHUB_ENV
if [[ -z $CUR_TAG ]]; then
echo "OLD_PRE_TAG=NULL" >> $GITHUB_ENV
else
echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV
fi
- name: Pack Artifacts
run: |
zip -r OpenCore-alpha-${SHORT_SHA}.zip Y7000P-Memory-overclocking
- name: Generate Prerelease Release Notes
run: |
echo '### 免责声明::' >> ReleaseNotes.md
echo '***此 Alpha 版本仅用于测试。***' >> ReleaseNotes.md
echo '它尚未准备好供日常使用,我们不保证其可用性。' >> ReleaseNotes.md
echo '如果您发现问题并且没有调试技能,请在打开问题之前提前与[QQ聊天室](https://qm.qq.com/cgi-bin/qm/qr?k=fnfunVaG-Z_occpl9QQDNaHB-B4S-ole&jump_from=webapi)联系。' >> ReleaseNotes.md
echo '### 最新的五个更新是:' >> ReleaseNotes.md
git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md
- name: Delete Old Prerelease
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
tag_name: ${{ env.OLD_PRE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Publish GitHub Release
if: contains(github.event.head_commit.message, 'Bump version') == false
uses: ncipollo/release-action@v1.8.6
with:
prerelease: true
bodyFile: ReleaseNotes.md
artifacts: "*.zip"
tag: "v${{ env.OPENCORE_VER }}-alpha"
token: ${{ secrets.GITHUB_TOKEN }}