-
Notifications
You must be signed in to change notification settings - Fork 90
47 lines (41 loc) · 1.22 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
name: Release
on:
push:
tags: 'v*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Version number
id: version
run: |
VERSION="${GITHUB_REF/refs\/tags\/v/}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Build distribution tarball
id: build
run: |
sudo apt-get install libbluetooth-dev libusb-1.0-0-dev
autoreconf --install --force
./configure
make
make distcheck
- name: Check tarball version number
id: check
run: |
FILENAME="libdivecomputer-${{ steps.version.outputs.version }}.tar.gz"
if [ ! -f "${FILENAME}" ]; then
echo ::error ::Tarball \'${FILENAME}\' not found!
exit 1
fi
- name: Create Github release
id: release
run: |
VERSION="${{ steps.version.outputs.version }}"
if [ "${VERSION}" != "${VERSION%%-*}" ]; then
PRERELEASE="-p"
fi
gh release create ${PRERELEASE} "${{ github.ref }}" "libdivecomputer-${VERSION}.tar.gz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}