-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a pre-release nudge github action
- Loading branch information
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Manual build signed Nudge and upload signed package (prerelease) | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout python repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Apple Xcode certificates | ||
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 | ||
with: | ||
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} | ||
p12-password: ${{ secrets.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" | ||
|
||
- name: get environment variables | ||
id: get_env_var | ||
run: | | ||
echo "NUDGE_VERSION=$(/bin/cat ./build_info.txt)" >> $GITHUB_ENV | ||
- 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 application as well as the package. | ||
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. | ||
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.0.pkg | ||
asset_name: Nudge_LaunchLogger-1.0.0.pkg | ||
asset_content_type: application/x-newton-compatible-pkg | ||
|
||
- name: Upload packages | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: packages | ||
path: outputs/ |