-
Notifications
You must be signed in to change notification settings - Fork 16
69 lines (68 loc) · 2.33 KB
/
bin-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
# Builds a single runtime package, this
# workflow is only invoked from the `bins.yaml` file
# to build the configured packages
#
# the built binary is ALWAYS published to tf-autobuilder
# and then tagged with a certain tag. this can be the version
# of the release or the `short sha` of the head, if on main
# branch
name: Build Extra Binary
on:
workflow_call:
inputs:
package:
description: "package to build"
required: true
type: string
secrets:
token:
required: true
jobs:
builder:
name: builder
runs-on: ubuntu-20.04
steps:
- name: Checkout code into the Go module directory
uses: actions/checkout@v1
# the tag step only extract the correct version
# tag to use. this is the short sha in case of
# a branch, or the tag name in case of "release"
# the value is then stored as `reference`
# and then accessed later in the workflow
- name: Set tag of build
id: tag
run: |
ref="${{ github.ref }}"
if [ "${{ github.ref_type }}" = "tag" ]; then
echo "reference=${ref#refs/tags/}" >> $GITHUB_OUTPUT
else
reference="${{ github.sha }}"
echo "reference=${reference:0:7}" >> $GITHUB_OUTPUT
fi
- name: Setup basesystem
run: |
cd bins
sudo -E ./bins-extra.sh --package basesystem
- name: Build package (${{ inputs.package }})
id: package
run: |
cd bins
sudo -E ./bins-extra.sh --package ${{ inputs.package }}
- name: Publish flist (tf-autobuilder, ${{ steps.package.outputs.name }})
if: success()
uses: threefoldtech/publish-flist@master
with:
token: ${{ secrets.token }}
action: publish
user: tf-autobuilder
root: bins/releases/${{ inputs.package }}
name: ${{ steps.package.outputs.name }}.flist
- name: Tagging
uses: threefoldtech/publish-flist@master
if: success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
token: ${{ secrets.token }}
action: tag
user: tf-autobuilder
name: ${{ steps.tag.outputs.reference }}/${{ inputs.package }}.flist
target: tf-autobuilder/${{ steps.package.outputs.name }}.flist