-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (131 loc) · 4.17 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: publish
on:
create:
tags:
- 'v*'
workflow_dispatch:
jobs:
macOS-binaries:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- name: Build elk
run: |
./build.sh x64
./build.sh arm64
- uses: actions/upload-artifact@v4
with:
name: macOS-x64
path: build/*-x64/*.tar.*
- uses: actions/upload-artifact@v4
with:
name: macOS-arm64
path: build/*-arm64/*.tar.*
linux-binaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- name: Install arm toolchain
run: |
sudo dpkg --add-architecture arm64
sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc) main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc)-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc)-backports main restricted universe multiverse
EOF'
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
sudo apt update
sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64
- name: Build elk
run: |
./build.sh x64
./build.sh arm64
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: build/*-x64/*.tar.*
- uses: actions/upload-artifact@v4
with:
name: linux-arm64
path: build/*-arm64/*.tar.*
windows-binaries:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- run: |
./Build.ps1 x64
./Build.ps1 arm64
Compress-Archive -Path build/win-x64 -Destination build/win-x64/win-x64.zip
Compress-Archive -Path build/win-arm64 -Destination build/win-arm64/win-arm64.zip
- uses: actions/upload-artifact@v4
with:
name: win-x64
path: build/*-x64/*.zip
- uses: actions/upload-artifact@v4
with:
name: win-arm64
path: build/*-arm64/*.zip
create-release:
runs-on: ubuntu-latest
needs: [linux-binaries, macOS-binaries, windows-binaries]
steps:
- uses: actions/checkout@v3
- run: |
mkdir build
- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
- name: Upload Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} build/**/*
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: |
./gen-docs.sh
- uses: netlify/actions/cli@master
with:
args: deploy --dir=docs/.vitepress/dist --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
push-vim-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: "PaddiM8/elk-vim"
ref: "main"
token: ${{ secrets.ACCESS_TOKEN_GITHUB }}
- run: |
git config --global user.email "<>"
git config --global user.name "GitHub Actions"
mv README.md ..
rm -rf *
git clone https://github.com/PaddiM8/elk elk-tmp
mv ../README.md .
cp -r elk-tmp/editors/vim/* .
rm -rf elk-tmp
git add .
git commit -m "${{ github.ref_name }}" || echo Didn't commit
git push origin main || echo Didn't push