-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (109 loc) · 3.24 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
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
name: Release
run-name: |
release [${{github.ref_type == 'tag' && 'stable' || 'nightly' }}, ${{github.ref_name}}]
on:
push:
branches:
- master
tags:
- '*'
- '!*/**'
concurrency:
group: release-default-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
env:
BASE_TAG: ubuntu:22.04
FLAVOR: default
TAG_SUFFIX: ''
UNO_MIDDLEWARE: ''
jobs:
config:
runs-on: ubuntu-latest
outputs:
BASE_TAG: ${{steps.config.outputs.BASE_TAG}}
DOCKER_FLAVOR_CONFIG: ${{steps.config.outputs.DOCKER_FLAVOR_CONFIG}}
DOCKER_TAGS_CONFIG: ${{steps.config.outputs.DOCKER_TAGS_CONFIG}}
FLAVOR: ${{steps.config.outputs.FLAVOR}}
TAG: ${{steps.config.outputs.TAG}}
UNO_MIDDLEWARE: ${{steps.config.outputs.UNO_MIDDLEWARE}}
steps:
- name: Clone uno
uses: actions/checkout@v4
with:
path: src/uno
submodules: true
- name: Configure build
id: config
run: |
case "${{github.ref_type}}" in
tag)
tag=latest
;;
branch)
tag=nightly
;;
esac
sha_short=$(cd src/uno && git rev-parse --short HEAD)
(
echo FLAVOR=${{env.FLAVOR}}
echo BASE_TAG=${{env.BASE_TAG}}
echo UNO_MIDDLEWARE=${{env.UNO_MIDDLEWARE}}
echo TAG=${{github.repository}}-test:${tag}${{env.TAG_SUFFIX}}
echo 'DOCKER_TAGS_CONFIG<<EOF'
if [ ${{ github.ref_type }} = branch ]; then
echo "type=raw,value=${tag},priority=650"
echo 'type=ref,event=branch'
fi
echo 'type=semver,pattern={{version}}'
echo 'type=semver,pattern={{major}}.{{minor}}'
echo 'type=semver,pattern={{major}}'
echo EOF
echo 'DOCKER_FLAVOR_CONFIG<<EOF'
echo 'suffix=${{env.TAG_SUFFIX}},onlatest=true'
echo EOF
) >> $GITHUB_OUTPUT
build:
needs: config
uses: ./.github/workflows/_release_build.yml
secrets: inherit
with:
uno-middleware: ${{ needs.config.outputs.UNO_MIDDLEWARE }}
base-tag: ${{ needs.config.outputs.BASE_TAG }}
tags-config: ${{ needs.config.outputs.DOCKER_TAGS_CONFIG }}
flavor-config: ${{ needs.config.outputs.DOCKER_FLAVOR_CONFIG }}
test:
needs:
- config
- build
strategy:
matrix:
platform: [amd64, arm64]
uses: ./.github/workflows/_release_test.yml
secrets: inherit
with:
tag: ${{needs.config.outputs.TAG}}
platform: ${{ matrix.platform }}
flavor: ${{ needs.config.outputs.FLAVOR }}
push:
needs:
- config
- test
uses: ./.github/workflows/_release_push.yml
secrets: inherit
with:
tag: ${{needs.config.outputs.TAG}}
flavor: ${{ needs.config.outputs.FLAVOR }}
tags-config: ${{ needs.config.outputs.DOCKER_TAGS_CONFIG }}
flavor-config: ${{ needs.config.outputs.DOCKER_FLAVOR_CONFIG }}
update_badges:
needs:
- config
- push
uses: ./.github/workflows/_release_badges.yml
secrets: inherit
with:
base-image: ${{ needs.config.outputs.BASE_TAG }}
flavor: ${{ needs.config.outputs.FLAVOR }}