-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (82 loc) · 3 KB
/
makefile.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
name: Makefile build
on:
push:
tags:
- 'releases/v*'
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: (Get metadata)
id: metadata
run: |
source buildconfig.sh
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "build=$build" >> "$GITHUB_OUTPUT"
echo "package=$package" >> "$GITHUB_OUTPUT"
echo "name=$name" >> "$GITHUB_OUTPUT"
echo "debug=$debug" >> "$GITHUB_OUTPUT"
- name: Install dependencies
run: sudo apt install zip bzip2 gzip tar curl bash
- name: Cache build environment downloads
id: cache-downloads
uses: actions/cache@v2
with:
path: build/deps
key: ${{ runner.os }}-build-${{ hashFiles('deps.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Download build environment
if: steps.cache-downloads.outputs.cache-hit != 'true'
run: make download
- name: Set up build environment
run: make configure
- name: Build
run: make build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.metadata.outputs.package }}-distrib-zip
path: build/dist/${{ steps.metadata.outputs.package }}/latest/*
if-no-files-found: error
publish:
name: Publish Tag Release (if applicable)
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/releases/v')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: (Get metadata)
id: metadata
run: |
source buildconfig.sh
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "build=$build" >> "$GITHUB_OUTPUT"
echo "package=$package" >> "$GITHUB_OUTPUT"
echo "name=$name" >> "$GITHUB_OUTPUT"
echo "debug=$debug" >> "$GITHUB_OUTPUT"
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: ${{ steps.metadata.outputs.package }}-distrib-zip
path: /tmp/distrib
- name: Release!
id: create_release
uses: softprops/action-gh-release@v1
with:
files: /tmp/distrib/*
tag_name: releases/v${{ steps.metadata.outputs.version }}
name: ${{ steps.metadata.outputs.name }} v${{ steps.metadata.outputs.version }}
body_path: latest-changes.md
draft: true
prerelease: ${{ steps.metadata.outputs.debug }}