-
Notifications
You must be signed in to change notification settings - Fork 69
87 lines (73 loc) · 2.43 KB
/
Copy pathnightly.yaml
File metadata and controls
87 lines (73 loc) · 2.43 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: nightly-release
on:
schedule:
- cron: "0 5 * * *" # 每天UTC 05:00运行
workflow_dispatch: # 允许手动触发
jobs:
nightly:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
submodules: recursive
- name: Install upx
run: sudo apt install upx -y
continue-on-error: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Configure Git
run: |
git config --global url."https://${{ secrets.PAT_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Set Version Info
run: |
echo "NIGHTLY_VERSION=nightly-$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
VERSION: ${{ env.NIGHTLY_VERSION }}
GOPATH: "/home/runner/go"
COMMIT: ${{ env.COMMIT }}
CGO_ENABLED: 0
- name: Download IoM-gui VSIX
uses: robinraju/release-downloader@v1.11
with:
repository: "chainreactors/IoM-gui"
latest: true
fileName: "iom.vsix"
token: ${{ secrets.PAT_TOKEN }}
out-file-path: "dist/vsix"
- name: Delete Old Nightly Releases
uses: dev-drprasad/delete-older-releases@v0.3.2
with:
keep_latest: 7
delete_tags: true
delete_tag_pattern: nightly
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Nightly Build ${{ env.NIGHTLY_VERSION }}
tag_name: nightly
prerelease: true
files: |
dist/**/*
body: |
🌙 Nightly build
📝 Commit: ${{ env.COMMIT }}
⚠️ This is an automated nightly build and may be unstable.
📦 This release includes the latest changes from the main branch.
Usage: https://chainreactors.github.io/wiki/IoM/manual/manual/GUI
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}