-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (65 loc) · 2.1 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
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
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
gh release download $TAG
tar -zxf exo.x86_64-unknown-linux-gnu.tar.gz
mv exo exo-amd64
tar -zxf exo.armv7-unknown-linux-gnueabihf.tar.gz
mv exo exo-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 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/exocore:latest"
fi
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build \
--tag appaquet/exocore:$TAG \
--platform linux/amd64,linux/arm \
--file $GITHUB_WORKSPACE/exo/Dockerfile.buildx \
$BUILD_PARAMS \
.