forked from oomek/attractplus
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (136 loc) · 5.11 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Realase
on:
push:
tags:
- '**'
env:
PKG_CONFIG_PATH_x86_64_w64_mingw32_static: /usr/lib/mxe/usr/x86_64-w64-mingw32.static/lib/pkgconfig/
jobs:
PackageAMx86:
name: Package ${{ matrix.platform.name }} ${{ matrix.config.name }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
platform:
- { name: Linux x64 KMS, targetos: linux-x86, amflags: USE_DRM=1 }
#- { name: Linux x64 X11, targetos: linux-x86 }
config:
- { name: shared, amflags: STATIC=0 }
- { name: static, amflags: STATIC=1 }
os: [ ubuntu-24.04, ubuntu-22.04, ubuntu-20.04 ]
exclude:
- platform: { targetos: linux-x86 }
config: { name: shared }
steps:
- name: AM+ - Checkout
uses: actions/checkout@v4
with:
path: am
- name: Prepare
id: vars
run: |
deb_version="$(head -1 am/debian/changelog | egrep -o "[0-9]+\.[0-9]+\.[0-9]+")"
fe_version=
[[ ${GITHUB_REF} =~ ^refs/tags/* ]] && fe_version="${GITHUB_REF#refs/*/}"
echo "fe_version=${fe_version}" >> $GITHUB_OUTPUT
echo "deb_version=${deb_version}" >> $GITHUB_OUTPUT
- name: Package AM+
uses: jtdor/build-deb-action@v1
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-pre-clean --no-sign
source-dir: am
- name: Rename AM+
run: |
find ./ -name '*.deb'
version="$(head -1 am/debian/changelog | egrep -o "[0-9]+\.[0-9]+\.[0-9]+")"
cp "./debian/artifacts/attractplus_${version}_amd64.deb" "attractplus_${version}_${{ matrix.os }}_amd64.deb"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: "./attractplus_${{ steps.vars.outputs.deb_version }}_${{ matrix.os }}_amd64.deb"
name: "attractplus_${{ steps.vars.outputs.deb_version }}_${{ matrix.os }}_amd64.deb"
compression-level: 0
PackageAMarm:
name: Package ${{ matrix.platform.name }} ${{ matrix.config.name }} on ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- { name: armv7, arch: armhf }
- { name: aarch64, arch: arm64 }
config:
- { name: shared, amflags: STATIC=0 }
- { name: static, amflags: STATIC=1 }
os: [ buster, bullseye, bookworm ]
exclude:
- config: { name: shared }
steps:
- name: AM+ - Checkout
uses: actions/checkout@v4
with:
path: am
- name: Prepare
id: vars
run: |
deb_version="$(head -1 am/debian/changelog | egrep -o "[0-9]+\.[0-9]+\.[0-9]+")"
fe_version=
[[ ${GITHUB_REF} =~ ^refs/tags/* ]] && fe_version="${GITHUB_REF#refs/*/}"
echo "fe_version=${fe_version}" >> $GITHUB_OUTPUT
echo "deb_version=${deb_version}" >> $GITHUB_OUTPUT
- name: Package AM+
uses: jtdor/build-deb-action@v1
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
buildpackage-opts: --build=binary --no-sign --no-pre-clean
source-dir: am
host-arch: ${{ matrix.platform.arch }}
docker-image: debian:${{ matrix.os }}-slim
- name: Rename AM+
run: |
find ./ -name '*.deb'
version="$(head -1 am/debian/changelog | egrep -o "[0-9]+\.[0-9]+\.[0-9]+")"
cp "./debian/artifacts/attractplus_${version}_${{ matrix.platform.arch }}.deb" "attractplus_${version}_${{ matrix.os }}_${{ matrix.platform.arch }}.deb"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: "./attractplus_${{ steps.vars.outputs.deb_version }}_${{ matrix.os }}_${{ matrix.platform.arch }}.deb"
name: "attractplus_${{ steps.vars.outputs.deb_version }}_${{ matrix.os }}_${{ matrix.platform.arch }}.deb"
compression-level: 0
Windows:
uses: ./.github/workflows/Windows.yml
MacOS:
uses: ./.github/workflows/MacOS.yml
Release:
name: Release to Github
needs: [PackageAMx86, PackageAMarm, Windows, MacOS]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare artifacts
id: prepare_artifacts
run: |
tag="${GITHUB_REF#refs/*/}"
echo "current_tag=${tag}" >> $GITHUB_OUTPUT
mkdir -p "${GITHUB_WORKSPACE}"/artifacts_for_release
ls -l "${GITHUB_WORKSPACE}"/artifacts/
find "${GITHUB_WORKSPACE}"/artifacts/ -name "*.deb" | while read f ; do
p="$(basename "$f")"
cp -v "$f" "${GITHUB_WORKSPACE}/artifacts_for_release/attractplus-${GITHUB_REF#refs/*/}-${p#attract-}"
done
7z a "attractplus-${GITHUB_REF#refs/*/}-Windows.7z" ./artifacts/Windows/*
7z a "attractplus-${GITHUB_REF#refs/*/}-MacOS.7z" ./artifacts/MacOS/*
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Attract Mode Plus ${{ steps.prepare_artifacts.outputs.current_tag }}
draft: true
prerelease: false
files: artifacts_for_release/attractplus-*.7z