-
Notifications
You must be signed in to change notification settings - Fork 4
123 lines (100 loc) · 3.34 KB
/
publish-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
120
121
122
123
name: Release publish
on:
workflow_dispatch:
inputs:
publish:
description: "Publish"
default: "true"
required: true
ref:
description: "Tag"
default: "v0.X.X"
required: true
latest:
description: "Latest"
default: "true"
required: true
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Download release files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
TAG="${{ github.event.inputs.ref }}"
mkdir $GITHUB_WORKSPACE/assets && cd $GITHUB_WORKSPACE/assets
hub release download $TAG
tar -zxf exm.x86_64-unknown-linux-gnu.tar.gz
mv exm exm-amd64
tar -zxf exm.armv7-unknown-linux-gnueabihf.tar.gz
mv exm exm-arm
- name: Setup Docker
run: |
set -x
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# Allows build in arm for qemu
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# Create builder
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx create --use --name exocore-builder
- name: Build & publish exomind Docker
run: |
set -x
TAG="${{ github.event.inputs.ref }}"
cd $GITHUB_WORKSPACE/assets/
BUILD_PARAMS=""
if [[ "${{ github.event.inputs.publish }}" == "true" ]]; then
BUILD_PARAMS="--push"
fi
if [[ "${{ github.event.inputs.publish }}" == "true" ]]; then
BUILD_PARAMS="$BUILD_PARAMS --tag appaquet/exomind:latest"
fi
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build \
--tag appaquet/exomind:$TAG \
--platform linux/amd64,linux/arm \
--file $GITHUB_WORKSPACE/exm/Dockerfile.buildx \
$BUILD_PARAMS \
.
- name: Build & publish exomind-web Docker
run: |
set -x
TAG="${{ github.event.inputs.ref }}"
BUILD_PARAMS=""
if [[ "${{ github.event.inputs.publish }}" == "true" ]]; then
BUILD_PARAMS="--push"
fi
if [[ "${{ github.event.inputs.publish }}" == "true" ]]; then
BUILD_PARAMS="$BUILD_PARAMS --tag appaquet/exomind-web:latest"
fi
mkdir $GITHUB_WORKSPACE/tmp && cd $GITHUB_WORKSPACE/tmp
cp $GITHUB_WORKSPACE/web/nginx.conf .
mkdir dist
tar -zxf $GITHUB_WORKSPACE/assets/exomind-web.tar.gz -C dist/
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build \
--tag appaquet/exomind-web:$TAG \
--platform linux/amd64,linux/arm \
--file $GITHUB_WORKSPACE/web/Dockerfile \
$BUILD_PARAMS \
.
ios_app_publish:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.publish == 'true' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Trigger iOS build
run: |
set -x
git push origin -f HEAD:app-build