-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (121 loc) · 3.76 KB
/
on-tags-push.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
name: 👷📦 Generate release
on:
push:
tags:
- "v*.*.*"
jobs:
linux-build:
name: 👷 Build files for packaging
runs-on: macos-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3.3.0
- name: 🏗️ Build application
run: make
- name: 💭 Cache application
uses: actions/cache@v3.2.2
id: vfo-build
with:
path: |
./bin/vfo
./src/vfo_config.conf
key: ${{ github.sha }}
apple-pkg:
name: 👷 Setup macOS .pkg
runs-on: macos-latest
timeout-minutes: 5 # Keeps your builds from running too long
needs: [linux-build]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3.3.0
- name: ❓Is brew installed
run: brew -v
- name: 🔨 Install xmlstarlet
run: brew install xmlstarlet
- name: ❓Is xmlstarlet installed
run: xmlstarlet --version
- name: 🔨 Install python
run: brew install python
- name: ❓ Is python installed
run: python -v
- name: 🤌💭 Fetch application cache
uses: actions/cache@v3.2.2
id: vfo-build
with:
path: |
./bin/vfo
./src/vfo_config.conf
key: ${{ github.sha }}
- name: ✍️ ReWrite version string in build-info.plist from tag
run: |
xmlstarlet ed --inplace -u "/plist/dict/string[@id=9]" -v $GITHUB_REF_NAME munki-pkg-workspace/build-info.plist
- name: 🫳 Position application to payload
run: |
cp bin/vfo munki-pkg-workspace/payload/bin
cp src/vfo_config.conf munki-pkg-workspace/payload/bin/vfo_conf_folder
- name: Run munkipkg 🧙♂️📦
id: munkipkg
uses: joncrain/munkipkg-action@5a6c2008ded522b67396a78c06983e614cbe22ac
with:
pkg_subdir: "munki-pkg-workspace"
# - name: 🏗️ Build Pkg file
# run: |
# python munki-pkg-workspace/munkipkg munki-pkg-workspace/vfo_macOS_installer
- name: 💭 Cache .pkg
uses: actions/cache@v3.2.2
id: macos-pkg
with:
path: |
./munki-pkg-workspace/build/*
key: ${{ github.sha }}
# linux-pkg:
# name: Setup Linux .pkg
# needs: [linux-build]
# windows-pkg:
# name: Setup Windows .pkg
# needs: [linux-build]
release:
name: 📦 Release
needs: [apple-pkg]
# linux-pkg, windows-pkg
runs-on: macos-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3.3.0
- name: 🤌💭 fetch Application Cache
uses: actions/cache@v3.2.2
id: vfo-build
with:
path: |
./bin/vfo
./src/vfo_config.conf
key: ${{ github.sha }}
- name: 🫳 Position application to static build folder
run: |
mkdir static_build
cp bin/vfo static_build
cp src/vfo_config.conf static_build
- name: 💁♂️ Generate static_build/README.txt
run: |
touch static_build/README.txt
echo -e "Place vfo & vfo_config.conf into your PATH" > static_build/README.txt
- name: 🤐 Zip static_build folder
run: zip -r static_build.zip static_build
- name: 🤌💭 fetch macOS .pkg Cache
uses: actions/cache@v3.2.2
id: macos-pkg
with:
path: |
./munki-pkg-workspace/build/*
key: ${{ github.sha }}
- name: 👷📦 Release static builds & macOS pkg
uses: softprops/action-gh-release@v0.1.15
# if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
body_path: RELEASE.txt
files: |
./munki-pkg-workspace/build/*
static_build.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}