-
Notifications
You must be signed in to change notification settings - Fork 66
94 lines (83 loc) · 2.89 KB
/
package.yaml
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
---
name: "Package mariner3d as .deb"
# yamllint disable-line rule:truthy
on:
push:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Extract Debian full package version
run: >-
echo "DEBIAN_PKG_FULL_VERSION=$(
head -1 dist/debian/changelog | awk -F'[()]' '{print $2}'
)" >> $GITHUB_ENV
- name: Extract Debian package version
run: >-
echo "DEBIAN_PKG_VERSION=$(
head -1 dist/debian/changelog |
awk -F'[()]' '{print $2}' |
cut -d '-' -f 1
)" >> $GITHUB_ENV
- name: Extract Python package version
run: >-
echo "PYTHON_PKG_VERSION=$(
cat pyproject.toml | grep version | awk -F'\"' '$0=$2'
)" >> $GITHUB_ENV
- name: Enforce Python package and Debian package version match
if: env.DEBIAN_PKG_VERSION != env.PYTHON_PKG_VERSION
run: exit 1
- name: Fetch new list of packages
run: sudo apt-get update
- name: Install qemu
run: >-
sudo apt-get -y --no-install-recommends install binfmt-support
qemu-user-static
- name: Setup docker with qemu
run: >-
docker run --rm --privileged multiarch/qemu-user-static:register
--reset
- name: Install yarn packages
run: cd frontend/ && yarn install
- name: Build frontend assets
run: cd frontend/ && yarn build
- name: Compute Debian package name
run: >-
echo "DEBIAN_PKG_FILENAME=mariner3d_${{
env.DEBIAN_PKG_FULL_VERSION
}}_armhf.deb" >> $GITHUB_ENV
- uses: satackey/[email protected]
continue-on-error: true
- name: Build Docker Image
run: docker build -f Dockerfile -t packager-image .
- name: Create docker container
run: docker create --name packager packager-image
- name: Prune dangling docker images
run: docker image prune -f
- name: Copy .deb file
run: >-
docker cp
packager:/build/${{ env.DEBIAN_PKG_FILENAME }}
${{ env.DEBIAN_PKG_FILENAME }}
- name: Shutdown container
run: docker rm -v packager
- uses: actions/upload-artifact@v2
with:
name: ${{ env.DEBIAN_PKG_FILENAME }}
path: ${{ env.DEBIAN_PKG_FILENAME }}
- name: Publish release binary
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.DEBIAN_PKG_FILENAME }}
asset_name: ${{ env.DEBIAN_PKG_FILENAME }}
tag: ${{ github.ref }}
overwrite: true