forked from FastFlowLM/FastFlowLM
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (114 loc) · 3.98 KB
/
Copy pathubuntu-build.yml
File metadata and controls
129 lines (114 loc) · 3.98 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
name: Build Packages
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
package-deb:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- version: "24.04"
codename: "noble"
distro: "ubuntu"
- version: "25.10"
codename: "questing"
distro: "ubuntu"
- version: "26.04"
codename: "resolute"
distro: "ubuntu"
- version: "13"
codename: "trixie"
distro: "debian"
container:
image: ghcr.io/fastflowlm/fastflowlm/build-environment:${{ matrix.distro }}${{ matrix.version }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Configure git safe directory
run: git config --global --add safe.directory $(pwd)
- name: Get version from git describe
id: get_version
run: |
VERSION=$(git describe --tags --always)
# Strip leading 'v' for Debian version compatibility
DEB_VERSION=$(echo "${VERSION}" | sed 's/^v//')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "deb_version=${DEB_VERSION}" >> $GITHUB_OUTPUT
- name: Get short SHA
id: short_sha
run: echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Create Debian packaging metadata
working-directory: ${{ github.workspace }}
run: |
sed -e "s|@@DEB_VERSION@@|${{ steps.get_version.outputs.deb_version }}|g" \
-e "s|@@DEB_CODENAME@@|${{ matrix.codename }}|g" \
-e "s|@@DEB_DATE@@|$(date -R)|g" \
debian/changelog.in > debian/changelog
chmod +x debian/rules
- name: Upgrade Rust toolchain
run: |
apt-get update
apt-get install -y --no-install-recommends curl ca-certificates
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
rustc --version
- name: Build Debian package
working-directory: ${{ github.workspace }}
env:
DEBEMAIL: noreply@example.com
DEBFULLNAME: fastflowlm
DEB_VERSION: ${{ steps.get_version.outputs.deb_version }}
run: |
dpkg-buildpackage -b -us -uc
mv ../fastflowlm_${DEB_VERSION}_amd64.deb ./fastflowlm_${DEB_VERSION}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb
ls -lah ./fastflowlm_${DEB_VERSION}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb
- name: Upload Debian package artifact
uses: actions/upload-artifact@v4
with:
name: flm-${{ matrix.distro }}${{ matrix.version }}-${{ steps.short_sha.outputs.sha }}-deb
path: ./fastflowlm_${{ steps.get_version.outputs.deb_version }}_${{ matrix.distro }}${{ matrix.version }}_amd64.deb
if-no-files-found: error
release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: package-deb
if: github.ref_type == 'tag'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from git describe
id: get_version
run: |
VERSION=$(git describe --tags --always)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Download all deb artifacts
uses: actions/download-artifact@v4
with:
path: debs
pattern: '*-deb'
- name: Upload Binaries to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file_glob: true
file: debs/*/*.deb