-
Notifications
You must be signed in to change notification settings - Fork 182
87 lines (74 loc) · 2.55 KB
/
fix-mac-released.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
name: Fix macOS permissions on latest released build
on:
workflow_dispatch:
inputs:
version:
description: "Version (\"vX.XX.X\" or \"latest\")"
default: "latest"
required: true
type: string
createZip:
description: "Create .zip file"
default: true
type: boolean
createTar:
description: "Create .tar.bz2 file"
default: true
type: boolean
createDmg:
description: "Create .dmg file"
default: true
type: boolean
env:
repository: YARC-Official/YARG
fileName: "*.zip"
extract: true
jobs:
fixMacBuild:
name: Fixing Mac permissions for ${{ inputs.version }}
runs-on: macos-latest
steps:
- if: ${{ inputs.version == 'latest' }}
name: Get Latest Release
uses: robinraju/release-downloader@v1.8
with:
repository: ${{ env.repository }}
fileName: ${{ env.fileName }}
extract: ${{ env.extract }}
token: ${{ secrets.GITHUB_TOKEN }}
latest: true
- if: ${{ inputs.version != 'latest' }}
name: Get specific release (${{ inputs.version }})
uses: robinraju/release-downloader@v1.8
with:
repository: ${{ env.repository }}
fileName: ${{ env.fileName }}
extract: ${{ env.extract }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ inputs.version }}
- name: Fix permissions
run: find . -name *.app -execdir chmod -R +x {}/Contents/MacOS \;
- name: Fix file attributes
run: find . -name *.app -execdir xattr -cr {} \; -execdir xattr -rd com.apple.quarantine {} \;
- name: Create Packages folder
run: mkdir Packages
- if: ${{ inputs.createZip == true }}
name: "Creating .zip"
run: find . -name *.app -execdir ditto -c -k --keepParent {} Packages/{}.zip \;
- if: ${{ inputs.createTar == true }}
name: "Creating .tar.bz2"
run: find . -name *.app -execdir tar --xattrs -c -j -f Packages/{}.tar.bz2 {} \;
- name: "Creating .dmg"
if: ${{ inputs.createDmg == true }}
continue-on-error: true
run: >
echo "- Installing create-dmg" &&
brew install graphicsmagick imagemagick &&
npm install --global create-dmg &&
echo "- Creating DMG" &&
find . -name *.app -execdir create-dmg --dmg-title=YARG {} Packages \;
- name: "Upload pacakges to artifacts"
uses: actions/upload-artifact@v3
with:
name: Packages
path: Packages