-
Notifications
You must be signed in to change notification settings - Fork 191
125 lines (105 loc) · 4.81 KB
/
build_nudge_prerelease_manual.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
name: Manual build signed Nudge and upload signed package (prerelease)
env:
NOTARY_APP_PASSWORD: ${{ secrets.NOTARY_APP_PASSWORD }}
on: [workflow_dispatch]
jobs:
build:
runs-on: macos-11
steps:
- name: Checkout nudge repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Apple Xcode certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
p12-file-base64: ${{ secrets.APP_CERTIFICATES_P12 }}
p12-password: ${{ secrets.APP_CERTIFICATES_P12_PASSWORD }}
- name: Install Apple Installer certificates
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
create-keychain: false # do not create a new keychain for this value
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
p12-file-base64: ${{ secrets.PKG_CERTIFICATES_P12 }}
p12-password: ${{ secrets.PKG_CERTIFICATES_P12_PASSWORD }}
- name: Run build package script
run: ./build_nudge.zsh "CREATE_PKG" "$NOTARY_APP_PASSWORD"
- name: get environment variables
id: get_env_var
run: |
echo "NUDGE_VERSION=$(/bin/cat ./build_info.txt)" >> $GITHUB_ENV
echo "NUDGE_MAIN_VERSION=$(/bin/cat ./build_info_main.txt)" >> $GITHUB_ENV
- name: get environment variable changelog # trick to get this to work for sed command
id: get_env_var_changelog
run: |
echo "NUDGE_CHANGELOG=$(/bin/cat ./CHANGELOG.md | awk "/v{{env.NUDGE_MAIN_VERSION}}/,EOF")" >> $GITHUB_ENV
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@6a73d830c3191442cb22efe153073b4a36e0c3ea # v3.0.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
reverse: 'true'
- name: Create Pre-Release
id: create_pre_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{env.NUDGE_VERSION}}
release_name: Nudge ${{env.NUDGE_VERSION}}
body: |
# Notes
This is a pre-release version of Nudge created by GitHub Actions.
Nudge.app has been signed and notarized. The package has been signed, notarized and stapled.
By default Nudge looks for a `com.github.macadmins.Nudge.json` file located in `/Library/Preferences`. If you would like to use an alternative path, please read the [README](https://github.com/macadmins/nudge/blob/main/README.md) or the [WIKI](https://github.com/macadmins/nudge/wiki)
## About the LaunchAgent
This is a basic launch agent that opens Nudge twice an hour, every 30 minutes.
If you would like to reduce the amount of times Nudge launches per day, it is recommended to create your own LaunchAgent.
# Changelog
${{env.NUDGE_CHANGELOG}}
# Changes
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: true
- name: Upload Signed Package Pre-Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ./outputs/Nudge-${{env.NUDGE_VERSION}}.pkg
asset_name: Nudge-${{env.NUDGE_VERSION}}.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: Upload Signed Package Pre-Release Asset (LaunchAgent)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ./outputs/Nudge_LaunchAgent-1.0.0.pkg
asset_name: Nudge_LaunchAgent-1.0.0.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: Upload Signed Package Pre-Release Asset (Logger)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ./outputs/Nudge_Logger-1.0.1.pkg
asset_name: Nudge_Logger-1.0.1.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: Upload Signed Package Pre-Release Asset (Suite)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ./outputs/Nudge_Suite-${{env.NUDGE_VERSION}}.pkg
asset_name: Nudge_Suite-${{env.NUDGE_VERSION}}.pkg
asset_content_type: application/x-newton-compatible-pkg
- name: Upload packages
uses: actions/upload-artifact@v1
with:
name: packages
path: outputs/