-
Notifications
You must be signed in to change notification settings - Fork 12
129 lines (126 loc) · 3.83 KB
/
build.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
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 and release Icaro
on:
push:
env:
go-version: '1.20'
node-version: 8
artifacts-retention-days: 5
jobs:
go-builds:
name: Build ${{ matrix.build.name }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.build.path }}
strategy:
matrix:
build:
- name: sun-api
path: sun/sun-api
- name: sun-tasks
path: sun/sun-tasks
- name: ade-api
path: ade/ade-api
- name: ade-tasks
path: ade/ade-tasks
- name: wax
path: wax
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.go-version }}
- name: Install dependencies
run: go get
- name: Build binary
run: CGO_ENABLED=0 go build
- name: Upload binary
uses: actions/[email protected]
with:
name: ${{ matrix.build.name }}
path: ${{ matrix.build.path }}/${{ matrix.build.name }}
retention-days: ${{ env.artifacts-retention-days }}
node-builds:
name: Build ${{ matrix.build.name }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ matrix.build.path }}
strategy:
matrix:
build:
- name: sun-ui
path: sun/sun-ui
- name: ade-ui
path: ade/ade-ui
- name: wings
path: wings
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build
- name: Create tar.gz
run: cd dist && tar cvzf ../${{ matrix.build.name }}.tar.gz .
- name: Upload tar.gz
uses: actions/[email protected]
with:
name: ${{ matrix.build.name }}
path: ${{ matrix.build.path }}/${{ matrix.build.name }}.tar.gz
retention-days: ${{ env.artifacts-retention-days }}
dedalo:
name: Build dedalo
runs-on: ubuntu-latest
defaults:
run:
working-directory: dedalo/dist
steps:
- uses: actions/checkout@v3
- name: Build dedalo rmp
run: |
docker run --name makerpms \
--volume $PWD:/srv/makerpms/src:ro ghcr.io/nethserver/makerpms:7 makerpms -s *.spec
docker commit makerpms nethserver/build
docker cp makerpms:/srv/makerpms/rpmbuild/RPMS/noarch/ RPMS
cp RPMS/* dedalo.rpm
- name: Upload dedalo
uses: actions/[email protected]
with:
name: dedalo
path: dedalo/dist/dedalo.rpm
retention-days: ${{ env.artifacts-retention-days }}
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master'
needs:
- go-builds
- node-builds
- dedalo
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
path: artifacts
- id: release
run: |
if [ "${{ github.ref }}" == 'refs/heads/master' ]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
echo "name=Automatic build" >> $GITHUB_OUTPUT
echo "tag_name=autobuild" >> $GITHUB_OUTPUT
echo "body=$(echo Last autobuild `date`)" >> $GITHUB_OUTPUT
git tag -f autobuild && git push -f origin autobuild
fi
- name: Release Icaro
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.release.outputs.name }}
tag_name: ${{ steps.release.outputs.tag_name }}
prerelease: ${{ steps.release.outputs.prerelease }}
body: ${{ steps.release.outputs.body }}
files: ./artifacts/*/*