-
Notifications
You must be signed in to change notification settings - Fork 3
115 lines (107 loc) · 2.92 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
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
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
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
- name: linux
runs-on: ubuntu-latest
multiarch: true
- name: darwin
runs-on: macos-latest
multiarch: false
arch:
- amd64
steps:
- name: Get Tag Name
id: info
shell: bash
env:
OS: ${{ matrix.os.name }}
ARCH: ${{ matrix.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 }}
install: ".[build]"
- name: Pyinstaller
id: installer
if: matrix.os.multiarch == false
run: pyinstaller scripts/installer.spec
- name: Buildx MultiArch Installer
if: matrix.os.multiarch
id: installer-multiarch
uses: duplocloud/actions/build-image@build-image-updates
with:
platforms: linux/amd64,linux/arm64
push: false
target: bin
cache-scope: installer
build-args: >
PY_VERSION=3.12
extra-args: --output=type=local,dest=./dist
- 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.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