forked from netchx/netch
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (93 loc) · 3.83 KB
/
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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Netch Release CI
on:
push:
tags:
- '*.*.*'
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checksum
shell: pwsh
run: |
echo "SOURCE_NETCH_SHA256=$(.\sha256.ps1 .\Netch)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_OTHER_SHA256=$(.\sha256.ps1 .\Other)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_REDIRECTOR_SHA256=$(.\sha256.ps1 .\Redirector)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
echo "SOURCE_ROUTEHELPER_SHA256=$(.\sha256.ps1 .\RouteHelper)" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
- name: Cache Netch
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-Netch-${{ env.SOURCE_NETCH_SHA256 }}
path: |
.\Netch\bin
- name: Cache Redirector
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-Redirector-${{ env.SOURCE_REDIRECTOR_SHA256 }}
path: |
.\Redirector\bin
- name: Cache RouteHelper
uses: actions/cache@v3
with:
key: Netch-${{ runner.os }}-RouteHelper-${{ env.SOURCE_ROUTEHELPER_SHA256 }}
path: |
.\RouteHelper\bin
- name: Check Other
id: check_other
uses: andstor/file-existence-action@v2
with:
files: .\other\release\aiodns.bin
- name: Setup Go
uses: actions/setup-go@v3
if: steps.check_other.outputs.files_exists == 'false'
with:
go-version: stable
- name: Setup C++
uses: msys2/setup-msys2@v2
if: steps.check_other.outputs.files_exists == 'false'
with:
update: true
release: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 mingw-w64-x86_64-freetype mingw-w64-x86_64-libpng mingw-w64-x86_64-bzip2 mingw-w64-x86_64-openssl mingw-w64-x86_64-mbedtls mingw-w64-x86_64-libsodium mingw-w64-x86_64-c-ares mingw-w64-x86_64-boost mingw-w64-x86_64-libmariadbclient unzip p7zip autoconf automake libtool
- name: Setup Rust
uses: actions-rs/toolchain@v1
if: steps.check_other.outputs.files_exists == 'false'
with:
toolchain: nightly
profile: minimal
- name: Build
shell: pwsh
run: |
.\build.ps1 -Configuration Release -OutputPath release
- name: Package
shell: pwsh
run: |
7z a -mx9 Netch.7z release
7z rn Netch.7z release Netch
- name: Checksum
shell: pwsh
run: |
$hash=(Get-FileHash Netch.7z -Algorithm SHA256).Hash.ToLower()
echo "NETCH_SHA256=$hash" | Out-File -Append -Encoding UTF8 -FilePath $Env:GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prerelease: ${{ contains(github.ref, '-') }}
draft: false
files: |
Netch.7z
body: |
[![](https://img.shields.io/badge/Telegram-Channel-blue)](https://t.me/netch_channel) [![](https://img.shields.io/badge/Telegram-Group-green)](https://t.me/netch_group)
## Changelogs
* This is an automated deployment of GitHub Actions, the change log should be updated manually soon
## 更新日志
* 这是 GitHub Actions 自动化部署,更新日志应该很快会手动更新
## 校验和
| 文件名 | SHA256 |
| :- | :- |
| Netch.7z | ${{ env.Netch_SHA256 }} |