-
Notifications
You must be signed in to change notification settings - Fork 3
177 lines (164 loc) · 4.57 KB
/
installer.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Pyinstaller
on:
workflow_dispatch:
inputs:
push:
description: Push the artifact to github.
required: false
default: true
type: boolean
tag:
description: The git tag to build on
required: false
type: string
include_mac_arm64:
description: Include the mac arm64 build
required: false
default: false
type: boolean
workflow_call:
inputs:
push:
description: Push the artifact to github.
required: false
default: true
type: boolean
tag:
description: The git tag to build on
required: false
type: string
include_mac_arm64:
description: Include the mac arm64 build
required: false
default: false
type: boolean
secrets:
GH_APP_KEY:
description: GitHub App private key
required: true
jobs:
installer:
name: Pyinstaller
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: windows
runs-on: windows-latest
multiarch: false
arch: amd64
- name: linux
runs-on: ubuntu-latest
multiarch: true
arch: amd64
- name: darwin
runs-on: macos-latest
multiarch: false
arch: amd64
env:
PY_VERSION: ${{ vars.PY_VERSION }}
steps:
- name: Get Tag Name
id: info
shell: bash
env:
OS: ${{ matrix.os.name }}
ARCH: ${{ matrix.os.arch }}
GIT_TAG: ${{ inputs.tag }}
run: |
if [ -z "${GIT_TAG}" ]; then
GIT_TAG=${GITHUB_REF#refs/*/}
fi
VERSION="${GIT_TAG#v*}"
NAME="duploctl-${VERSION}-${OS}"
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT
echo "NAME=${NAME}" >> $GITHUB_OUTPUT
- name: Setup
id: setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
ref: ${{ inputs.tag }}
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
python-version: ${{ env.PY_VERSION }}
install: ".[build]"
- name: Pyinstaller
id: installer
if: matrix.os.multiarch == false
run: pyinstaller scripts/installer.spec
# Use buildx to build the bin target which has the binary inside
# then output the binary to the dist folder
# see the docker-compose.yaml for the bake target
- name: Buildx MultiArch Installer
if: matrix.os.multiarch
id: installer-multiarch
uses: duplocloud/actions/build-image@build-image-registry-fix
env:
GIT_TAG: ${{ steps.info.outputs.GIT_TAG }}
with:
type: bake
target: duploctl-bin
- name: View Files
run: ls dist
- name: Single Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch == false && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-${{ matrix.os.arch }}
path: dist
- name: Amd Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-amd64
path: dist/${{ matrix.os.name }}_amd64
- name: Arm Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-arm64
path: dist/${{ matrix.os.name }}_arm64
installer_darwin_arm64:
name: Pyinstaller for Mac Arm64
if: inputs.include_mac_arm64
runs-on:
- self-hosted
- darwin
- arm64
env:
PY_VERSION: ${{ vars.PY_VERSION }}
steps:
- name: Get Tag Name
id: info
shell: bash
env:
OS: darwin
ARCH: arm64
GIT_TAG: ${{ inputs.tag }}
run: |
if [ -z "${GIT_TAG}" ]; then
GIT_TAG=${GITHUB_REF#refs/*/}
fi
VERSION="${GIT_TAG#v*}"
NAME="duploctl-${VERSION}-${OS}"
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT
echo "NAME=${NAME}" >> $GITHUB_OUTPUT
- name: Setup
id: setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
ref: ${{ inputs.tag }}
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
python-version: ${{ env.PY_VERSION }}
install: ".[build]"
- name: Pyinstaller
id: installer
run: pyinstaller scripts/installer.spec
- name: Single Artifact
uses: actions/upload-artifact@v4
if: inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-arm64
path: dist