-
Notifications
You must be signed in to change notification settings - Fork 68
84 lines (69 loc) · 2.17 KB
/
main.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
#
# This is free software, license use GPLv3.
#
# Copyright (c) 2020, Chuck <[email protected]>
#
name: openwrt-23.05
on:
push:
branches: [ openwrt-23.05 ]
tags:
- v23.05.*
pull_request:
branches: [ openwrt-23.05 ]
jobs:
build:
strategy:
matrix:
target: [ x86-64, nanopi-r2s ]
runs-on: ubuntu-22.04
steps:
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Shanghai"
timezoneMacos: "Asia/Shanghai"
timezoneWindows: "China Standard Time"
- name: Checkout Project
uses: actions/checkout@v4
with:
ref: openwrt-23.05
- name: Initialize environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo du -xh -d4 --exclude=/{proc,sys,dev} / | grep -E '^[0-9.]*?[GTPEZY]'
sudo rm -rf /usr/local/lib/android
sudo apt-get update
sudo apt-get install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libelf-dev libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget
sudo apt-get autoremove --purge
sudo apt-get clean
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
df -h
- name: Build OpenWrt
run: |
./build.sh -t ${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openwrt-${{ matrix.target }}
path: artifact
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
- name: Create release tarball
run: |
release_version=${GITHUB_REF_NAME#v}
echo "RELEASE_VERSION=$release_version" >>"$GITHUB_ENV"
for artifact in openwrt-*; do
pushd "$artifact"
tar -zcf ../openwrt-"$release_version"-"${artifact#openwrt-}".tar.gz *
popd
done
- uses: softprops/action-gh-release@v1
with:
files: openwrt-${{ env.RELEASE_VERSION }}-*.tar.gz