Skip to content

Commit

Permalink
add a pre-release nudge github action
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed Feb 24, 2021
1 parent 992d626 commit b90c3c6
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build_nudge_prerelease_manual.yml
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/

0 comments on commit b90c3c6

Please sign in to comment.