forked from sbwml/luci-app-openlist2
-
Notifications
You must be signed in to change notification settings - Fork 10
139 lines (123 loc) · 4.36 KB
/
release-build.yml
File metadata and controls
139 lines (123 loc) · 4.36 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
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
134
135
136
137
138
139
name: Build Packages
on:
repository_dispatch:
types: [release-build]
permissions:
contents: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Create release tag and release
id: create_release
run: |
TAG_NAME="${{ github.event.client_payload.release_tag }}"
RELEASE_NAME="${{ github.event.client_payload.release_name }}"
echo "Creating tag: $TAG_NAME"
echo "Creating release: $RELEASE_NAME"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag "$TAG_NAME" || echo "Tag already exists"
git push origin "$TAG_NAME" || echo "Tag already pushed"
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
name: ${{ github.event.client_payload.release_name }}
tag: ${{ github.event.client_payload.release_tag }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
body: |
## Release ${{ github.event.client_payload.release_tag }}
This release contains OpenWrt packages built for multiple architectures.
**Source Repository:** ${{ github.event.client_payload.source_repository }}
build:
name: Build ${{ matrix.arch }}-${{ matrix.sdk }}
runs-on: ubuntu-latest
needs: create-release
strategy:
fail-fast: false
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_cortex-a76
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a7_vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
- arm_xscale
- i386_pentium-mmx
- i386_pentium4
- loongarch64_generic
- mips64_mips64r2
- mips64_octeonplus
- mips64el_mips64r2
- mips_24kc
- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- riscv64_riscv64
- x86_64
sdk:
- openwrt-24.10
- SNAPSHOT
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Build with Static Linking
run: |
sed -i '/golang-package/a \\tGO_PKG_DEFAULT_LDFLAGS:=-w -s -extldflags "-static"' openlist/Makefile
- name: UPX Compress
if: ${{ matrix.arch != 'loongarch64_generic' && matrix.arch != 'mips64_mips64r2' && matrix.arch != 'mips64_octeonplus' && matrix.arch != 'mips64el_mips64r2' && matrix.arch != 'riscv64_riscv64' }}
run: |
sed -i '/openlist.init/a \\t/usr/bin/upx --lzma --best $(1)\/usr\/bin\/openlist' openlist/Makefile
- name: Build Packages
uses: OpenListTeam/openwrt-gh-action-sdk@go1.25
env:
ARCH: ${{ matrix.arch }}-${{ matrix.sdk }}
FEEDNAME: packages_ci
PACKAGES: luci-app-openlist
NO_REFRESH_CHECK: true
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}-${{ matrix.sdk }}
path: |
bin/packages/${{ matrix.arch }}/packages_ci/*.apk
bin/packages/${{ matrix.arch }}/packages_ci/*.ipk
- name: Create compress files
continue-on-error: true
run: |
tar -zcvf ${{ matrix.sdk }}-${{ matrix.arch }}.tar.gz -C bin/packages/${{ matrix.arch }}/ packages_ci
- name: Upload packages to release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.client_payload.release_tag }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replacesArtifacts: false
omitBody: true
omitName: true
artifacts: "${{ matrix.sdk }}-${{ matrix.arch }}.tar.gz"